客户端开发单选题

使用JavaScript向网页中输出<h1>hello</h1>,以下代码中可行的是

<script type="text/javascript"> 
document.write("<h1>hello</h1>"); 
</script>

<h1> 
<script type="text/javascript"> 
document.write("hello"); 
</script> 
</h1>

下面不属于空元素的是

A: A .a

B: B. input

C: C.images

D: D.br

答案是A

以下哪四个能使用throw抛出

A: A.Error

B: B.Event

C: C.Objec

D: D.Throwable

E: E.xception

F: F.RuntimeException

正确答案:A,D,E,F

下面代码输出什么
public class Reluctant {
private Reluctant internalInstance = new Reluctant();
public Reluctant() throws Exception {
throw new Exception("I'm not coming out");
}
public static void main(String[] args) {
try {
Reluctant b = new Reluctant();
System.out.println("Surprise!");
} catch (Exception ex) {
System.out.println("I told you so");
}
}
}

A: A. 编译错误

B: B. Surprise!

C: C. 运行时抛错

D: D. I told you so

正确答案:C

使用protocol时,声明一组可选择实现的函数需加上

A: A.@required

B: B.@optional

C: C.@interface

D: D.@protocol

正确答案:B

猜你喜欢

转载自blog.csdn.net/boguesfei/article/details/81947700
今日推荐