当前位置:首页 > Java经典笔试题
for(int i=0;i<6;i++) {
sum+=a[i]; }
System.out.println(\ }
catch(java.lang.ArrayIndexOutOfBoundsException e) {
System.out.println(\数组下标越界\ }
finally {
System.out.println(\程序结束\ } } }
输出结果将是()
a. 10 数组下标越界 程序结束 b. 10 程序结束
c. 数组下标越界 程序结束 d. 程序结束
37.研究下面JAVA代码
public class TestException {
/**
* @param args */
public static void main(String[] args) { try {
System.out.println(\ System.exit(0); }
finally {
System.out.println(\ } } }
输出结果为() a. hello,jr b. 88
c. hello,jr后是88 d. 不能编译
38.研究下列代码 public class Test {
String s = \
public void test(String s) {
System.out.println(\
System.out.println(\
this.s=s;
System.out.println(\
System.out.println(\ }
/**
* @param args */
public static void main(String[] args) { new Test().test(\ } }
将输出结果()
a. s:cba this.s:nba s:cba this.s:nba b. s:nba this.s:nba s:nba this.s:nba c. s:cba this.s:nba s:cba this.s:cba d. s:nba this.s:cba s:cba this.s:cba
39.在JAVA中,关键字()使类不能派生出子类 a.final b.public c.private d.native
40.关于sleep和wait方法,下列说法不正确的是()(多选) a.sleep必须使用在同步方法中
b.使用wait方法后,线程需要被通知唤醒 c.wait方法用于线程之间的通讯 c.wait是Thread类的方法
d.sleep表示让线程休眠一段时间后继续运行 因为一个抽象方法是让子类去重写的
共分享92篇相关文档