东师Java程序设计17春在线作业1-4

  • 格式:docx
  • 大小:15.16 KB
  • 文档页数:5

东师Java程序设计17春在线作业1
一、单选题
1、C
2、C
3、A
4、B
5、B
一、单选题(共10 道试题,共30 分。

)V 1. 下面代码的执行结果是什么?( )<html><body><% x=3; %><% int x=5; %><%! int x=7; %> x = <%=x%>, <%=this.x%></body></html>
A. x = 3, 5
B. x = 3, 7
C. x = 5, 3
D. x = 5, 7
正确答案:C
2. 下面哪行是正确的?()
A. <jsp:use Bean action="get" id="address" property="city" />
B. <jsp:get Property id="address" property="city" />
C. <jsp:get Property name="address" property="city" />
D. <jsp:get Property bean="address" property="*" />
正确答案:C
3. 下列说法中不正确的一项是( )。

A. Tread类中没有义run()方法
B. 可通过继承Thread类来创建线程
C. Runnable 类中定义了run()方法
D. 可以通过实现Runnable接口来创建线程
正确答案:A
4. 在编写Java Applet程序时,需要在程序的开头写上( )语句。

A. import java.awt.* ;
B. import java.applet.* ;
C. import java.io.* ;
D. import java.awt.event.* ;
正确答案:B
5. 哪个关键字可以对对象加互斥锁? ( )
A. transient
B. synchronized
C. serialize
D. static
正确答案:B
6. 在类中若要处理ActionEvent事件,则该类需要实现的接口是()。

A. ActionListener
B. Runnable
C. Serializable
D. Event
正确答案:A
7. 在Applet的关键方法中,关闭浏览器以释放Applet占用的所有资源的方法是()。

A. init()。