1.Math.round(11.5)等于多少? Math.round(-11.5)等于多少?
A.11—— 11
B.11 ——11
C.12——12
D.12 ——11
2.
1.Float pi = new Float(3.14f);
2. if (pi > 3) {
3. System.out.print("pi is bigger than 3. ");
4. }
5. else {
6. System.out.print("pi is not bigger than 3. ");
7. }
8. finally {
9. System.out.println("Have a nice day.");
10. }
输出结果是()
A. 编译失败。
B. pi is bigger than 3.
C. 在运行时发生n个异常。
D. pi is bigger than 3. Have a nice day.
E. pi is not bigger than 3. Have a nice day.
3.数组有没有length()这个方法? String有没有length()这个方法
A. 有 没有
B. 有 有
C. 没有 没有
D. 没有 有
4.List, Set, Map哪一个不是继承自Collection接口?
A. List
B. Set
C. Map
D. 都继承自Collection接口
5.是否可以从一个static方法内部发出对非static方法的调用?
A. 是
B. 否
6.下列哪个叙述是正确的()
A. 创建File对象可能发生异常。
B. BufferedRead流可以指向FileInputStream流
C. BufferedWrite流可以指向FileWrite流
D.RadomAccessFile流一旦指向文件,就会刷新该文件
7.为了向文件hello.txt尾加数据,下列哪个是正确创建指向hello.txt的流?
A. try{ OutputStream out = new FileOutputStream(“hello.txt”);
}
catch(IOException e){}
B. try { OutputStream out = new FileOutputStream(“hello.txt”,true);
}
catch(IOException e){}
C.try{ OutputStream out = new FileOutputStream(“hello.txt”,false);
}
catch(IOException e){}
D.try{ OutputStream out = new OutputStream(“hello.txt”,true);
}
catch(IOException e){}
8.下面关于Java类的构造方法的说法中正确的是:( )
A. 一个类至少有一个构造方法
B. 构造方法的返回值类型必须是void
C. 构造方法的可见性修饰符必须是public
D. 构造方法必须显式的定义
9.为什么构造方法里 this 或者 super 函数调用必须放在第一行且无法共存?
10.Java 构造方法能否被重写和重载?
昨天的答案已经分享到公众号了?聪明的你答对几个?如果还有不不解之处请在下面留言,我们小编会在第一时间为您解答!,可以关注我们查看
答案!