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

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

87. What is true about a thread?
A The only way you can create a thread is to subclass java.lang.Thread
B If a Thread with higher priority than the currently running thread is created, the thread with the higher priority runs.
C.
D.
E.
B (not sure)
88. What happens when you compile the following code?
public class Test {
public static void main(String args[] ) {
int x;
System.out.println(x);
}
A. Error at compile time. Malformed main method
B. Clean compile
C. Compiles but error at runtime. X is not initialized
D.
E. Compile error. Variable x may not have been initialized.
E.
89. What happens when you run the following program with the command:
java Prog cat dog mouse
public class Prog {
public static void main(String args[]) {
System.out.println(args) ;
}
A. Error at compile time. ArrayIndexOutOfBoundsException thrown
B. Compile with no output
C. Compile and output of dog
D. Compile and output of cat
E. Compile and output of mouse
D.
90. Which number for the argument must you use for the code to print cat?
With the command:
java Prog dog cat mouse
public class Prog {
public static void main(String args[]) {
System.out.println(args[?]) ;
}
}
A. 0
B. 1
C. 2
D. 3
E. none of these
B.
页: [1]
查看完整版本: JAVA认证历年真题:310-025精选题(26)