分类信息
SCJP认证历年经典考题(10)
时间:2013-10-22
来源:Java认证考试网 浏览次数:172
【华夏培训网:中国教育培训第一门户】
QuestionNo41 Given: 1.publicclassX( 2.publicobjectm(){ 3.objecto=newfloat(3.14F); 4.objectoa=newobject[1]; 5.oa[0]=o; 6
Question No 41
Given:
1. public class X (
2. public object m () {
3. object o = new float (3.14F);
4. object oa = new object [1];
5. oa[0]= o;
6. o = null;
7. return oa[0];
8. }
9. }
When is the float object created in line 3, eligible for garbage collection?
A. Just after line 5
B. Just after line 6
C. Just after line 7 (that is, as the method returns)
D. Never in this method.
Answer: D
Question No 42
Given:
3. string foo = “ABCDE”;
4. foo.substring(3);
5. foo.concat(“XYZ”);
6.
Type the value of foo at line 6.
Answer: ABCDE
Question No 43
Which method is an appropriate way to determine the cosine of 42 degrees?
A. Double d = Math.cos(42);
B. Double d = Math.cosine(42);
C. Double d = Math.cos(Math.toRadians(42));
D. Double d = Math.cos(Math.toDegrees(42));
E. Double d = Math.cosine(Math.toRadians(42));
Answer: C
Question No 44
You need to store elements in a collection that guarantees that no duplicates are stored and all elements
can be accessed in natural order. Which interface provides that capability?
A. Java.util.Map.
B. Java.util.Set.
C. Java.util.List.
D. Java.util.StoredSet.
E. Java.util.StoredMap.
F. Java.util.Collection.
Answer: D
Java认证
下一篇:Java认证scjp考试经验技巧
上一篇:SCJP认证历年经典考题(9)