没有合适的资源?快使用搜索试试~ 我知道了~
scjp试题
资源详情
资源评论
资源推荐
Sun Certified Programmer for the Java 2
Platform, Standard
Exam 310-055
E
di
ti
on
5.0
telankesjiang@gmail.com
LTD All Rights Reserved
For the friends in CSDN
And Matrix!
C
o
n
g
r
a
t
u
l
a
t
i
o
n
s
!
!
Y
o
u
h
a
v
e
p
u
r
ch
ased
a
Tes
t
k
i
l
l
e
r
L
t
d
.
S
t
ud
y
G
u
i
d
e
.
This study guide is a complete collection of questions that have been directly taken from
the real exams and answers that have been researched and verified by our professional
expert team. Study and memorize the following questions and answers for approximately
15
t
o
2
0
h
o
u
r
s
a
n
d
y
o
u
w
ill
b
e
p
r
epa
r
e
d
t
o
t
a
k
e
t
h
e
e
x
a
m
s
.
W
e
g
u
a
r
an
t
e
e
i
t!
R
e
m
e
m
b
e
r
,
a
v
e
r
a
ge
s
t
u
d
y
t
i
m
e
i
s
1
5
t
o
2
0
h
o
u
r
s
a
n
d
t
h
e
n
y
o
u
a
r
e
r
ea
d
y
!!
!
GOO
D
L
U
C
K
!
D
I
S
C
L
A
I
M
E
R
This study guide and/or material is not sponsored by, endorsed by or affiliated with
Microsoft, Cisco, Oracle, Citrix, CIW, CheckPoint, Novell, Sun/Solaris, CWNA, LPI,
ISC, etc. All trademarks are properties of their respective owners
.
G
u
a
r
a
n
t
e
e
If you use this study guide correctly and still fail the exam, send a scanned copy of your
o
ffi
c
i
a
l
s
c
or
e
n
o
t
i
ce
a
t:
supp
o
r
t
@
t
ro
y
t
e
c
.
c
o
m
We will gladly refund the cost of this study guide. However, you will not need this
gu
a
r
an
t
ee
i
f
y
o
u
f
o
ll
o
w
t
h
e
a
b
o
v
e
i
n
s
t
r
u
c
t
i
o
n
s
.
T
his
m
a
te
r
ia
l is p
r
otected b
y
cop
y
r
ight l
a
w
a
nd inte
r
n
a
tion
a
l t
r
e
a
ties. Un
a
utho
r
i
z
ed
r
ep
r
oduction o
r
dist
r
ibution o
f t
his
m
a
te
r
i
a
l, o
r
a
n
y
po
r
tion the
r
eo
f,
m
a
y
r
esult in se
v
e
r
e
c
iv
il
a
nd c
r
im
in
a
l pen
a
lties,
a
nd
w
ill be p
r
osecuted to the
m
a
x
i
m
u
m
e
x
tent possible unde
r
l
a
w
.
Question 1
Given:
11. public interface Status {
12. /* insert code here */ int MY_VALUE = 10;
13. }
Which three are valid on line 12? (Choose three.)
A. final
B. static
C. native
D. public
E. private
F. abstract
G. protected
Answer: ABD
Question 2
Given:
10. public class Bar {
11.static void foo(int...x) {
12. // insert code here
13. }
14. }
Which two code fragments, inserted independently at line 12, will allow
the class to compile? (Choose two.)
A. foreach(x) System.out.println(z);
B. for(int z : x) System.out.println(z);
C. while( x.hasNext()) System.out.println( x.next());
D. for( int i=0; i< x.length; i++ ) System.out.println(x[i]);
Answer: BD
Question 3
Given:
11. public class Test {
12. public static void main(String [] args) {
13. int x =
5;
14. boolean b1 = true;
15. boolean b2 = false;
16.
17.if((x==4) && !b2)
18. System.out.print(”l “);
19. System.out.print(”2 “);
20. if ((b2 = true) && b1)
21. System.out.print(”3 “);
22. }
23. }
What is the result?
A. 2
B. 3
C. 1 2
D. 2 3
E. 1 2 3
F. Compilation fails.
G. Au exceptional is thrown at runtime.
Answer: D
Question 4
4. Given:
31. // some code here
32. try {
33. // some code here
34. } catch (SomeException se) {
35. // some code here
36. } finally {
37. // some code here
38. }
Under which three circumstances will the code on line 37 be executed?
(Choose three.)
A. The instance gets garbage collected.
B. The code on line 33 throws an exception.
C. The code on line 35 throws an exception.
D. The code on line 31 throws an exception.
E. The code on line 33 executes successfully.
Answer: BCE
Question 5
Given:
10. interface Foo {}
11. class Alpha implements Foo { }
12. class Beta extends Alpha {}
13. class Delta extends Beta {
14. public static void main( String[] args) {
15. Beta x = new Beta();
16. // insert code here
17. }
18. }
Which code, inserted at line 16, will cause a
java.lang.ClassCastException?
A. Alpha a = x;
B. Foo f= (Delta)x;
C. Foo f= (Alpha)x;
D. Beta b = (Beta)(Alpha)x;
Answer: B
Question 6
Given:
• d is a valid, non-null Date object
• df is a valid, non-null DateFormat object set to the
current locale
What outputs the current locales country name and the appropriate
version of d’s date?
A. Locale loc = Locale.getLocale();
System.out.println(loc.getDisplayCountry()
+ “ “+ df.format(d));
B. Locale loc = Locale.getDefault();
System.out.println(loc.getDisplayCountry()
+ “ “ + df.format(d));
C. Locale bc = Locale.getLocale();
System.out.println(loc.getDisplayCountry()
+ “ “+ df.setDateFormat(d));
D. Locale loc = Locale.getDefault();
System.out.println(loc.getDispbayCountry()
+ “ “+ df.setDateFormat(d));
Answer: B
Question 7
Given:
20. public class CreditCard {
21.
22. private String cardlD;
23. private Integer limit;
24. public String ownerName;
25.
26. public void setCardlnformation(String cardlD,
27. String ownerName,
28. Integer limit) {
29. this.cardlD = cardlD;
剩余119页未读,继续阅读
magicianleo
- 粉丝: 1
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0