会计考友 发表于 2012-8-4 12:33:16

JAVA认证历年真题:310-025精选题(7)

19. Consider the following code:
1. public void method(String s){
2. String a,b;
3. a = new String("Hello");
4. b = new String("Goodbye");
5. System.out.println(a + b);
6. a = null;
7. a = b;
8. System.out.println(a + b);
9. }
Where is it possible that the garbage collector will run the first time?
A. Just before line 5
B. Just before line 6
C. Just before line 7
D. Just before line 8
E. Never in this method
C.
20. Which code fragments would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?
A. int count = args.length;
B. int count = args.length - 1;
C. int count = 0;
while (args != null)
count ++;
D. int count = 0;
while (!(args.equals("")))
count ++;
A.
21. Which are keywords in Java?
A.sizeof
B.abstract
C.native
D.NULL
E.BOOLEAN
BC.
页: [1]
查看完整版本: JAVA认证历年真题:310-025精选题(7)