没有合适的资源?快使用搜索试试~ 我知道了~
首页java scjp认证考试题库
资源详情
资源评论
资源推荐
310-
035
QUESTION 2:
Which two cause a compiler error?
(Choose two)
A. float[] = new float(3);
B. float f2[] = new float[];
C. float[] f1 = new
float[3];
D. float f3[] = new
float[3];
E. float f5[] = { 1.0f, 2.0f, 2.0f };//初始化
F. float f4[] = new float[] { 1.0f. 2.0f. 3.0f}; // float f4[] = new float[]
{ 1.0f,2.0f,3.0f};
Answer: A, B
The F. statement is incorrect. The float numbers should be separated with
commas and not dots.
QUESTION 3:
Given:
11. int i =1,j =10;
12. do {
13. if(i++> --j) {
14. continue;
15. }
16. while (i <5);
17. System.out.println("i = " +i+ "and j = "+j); What is the result?
A. i = 6 and j = 5
B. i = 5 and j = 5
C. i = 6 and j = 5
D. i = 5 and j = 6
E. i = 6 and j = 6
Answer: D
QUESTION 5:
Given:
1. interface Animal {
2. void soundOff();
3. }
4.
5. class Elephant implements Animal {
6. public void soundOff() {
7. System.out.println("Trumpet");
8. }
9. }
10.
11. class Lion implements Animal {
12. public void soundOff() {
13. System.out.println("Roar");
14. }
15. }
16.
17. class Alpha1 {
18. static Animal get( String choice ) {
19. if ( choice.equalsIgnoreCase( "meat eater" )) {
20. return new Lion();
21. } else {
22. return new Elephant();
23. }
24. }
25. }
Which compiles?
A. new
Animal().soundOff(); B.
Elephant e = new
Alpha1();
C. Lion 1 = Alpha.get("meat eater");
D. new
Alpha1().get("veggie").soundOff();
Answer: D
QUESTION 6:
Which statement is true?
A. Memory is reclaimed by calling Runtime.gc().
B. Objects are not collected if they are accessible from
live threads.
C. Objects that have finalize() methods are never
garbage collected.
D. Objects that have finalize() methods always have their finalize() methods
called before the program ends.
E. An OutOfMemory error is only thrown if a single block of memory
cannot be found that is large enough for a particular requirement.
Answer: B
QUESTION 7:
Given:
1. class A {
Actualte s ts . com - The Po w er of Kno w ing
310-
035
2. A() { }
3. }
4.
5. class B extends A {
6. }
Which two statements are true? (Choose two)
A. Class B's constructor is public.
B. Class B's constructor has no arguments.
C. Class B's constructor includes a call to this().
D. Class B's constructor includes a call to
super(). Answer: B, D
QUESTION 8:
Given:
11. int i = 1,j = 10;
12. do {
13. if(i>j) {
14. break;
15. }
16. j--;
17. } while (++i <5);
18. System.out.println("i =" +i+" and j =
"+j); What is the result?
A. i = 6 and j = 5
B. i = 5 and j = 5
C. i = 6 and j = 4
D. i = 5 and j = 6
E. i = 6 and j = 6
Answer: D
310-
035
QUESTION 10:
You want a class to have access to members of another class in the same package.
Which
is the most restrictive access that accomplishes this objective?
A. public
B. private
C. protected
D. transient
E. default access
Answer: E
QUESTION 11:
Given:
11. int x = 3;
12. int y = 1;
13. if (x = y) {
14. System.out.println("x = " + x);
15. }
What is the result?
A. x = 1
B. x = 3
C. Compilation fails.
D. The code runs with no output.
E. An exception is thrown at
runtime.
Answer: C
QUESTION 13:
Given:
1. public interface Foo {
2. int k = 4;
3. }
Which three are equivalent to line 2? (Choose three)
A. final int k =
剩余63页未读,继续阅读
hongyangshu117
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1