black

SCJP程序员认证考试

登录

单项选择题

public class Threads4 { 
public static void main (String[] args) { 
new Threads4().go(); 
} 
public void go() { 
Runnable r = new Runnable() {
public void run() { 
System.out.print(”foo”); 
} 
}; 
Thread t = new Thread(r); 
t.start(); 
t.start(); 
} 
} 
What is the result?() 

A. Compilation fails.
B. An exception is thrown at runtime.
C. The code executes normally and prints „foo”.
D. The code executes normally, but nothing is printed.

相关考题

单项选择题 public class Threads3 implements Runnable {  public void run() {  System.out.print(”running”);  }  public static void main(String[] args) {  Thread t = new Thread(new Threads3());  t.run();  t.run();  t.start();  }  }  What is the result?()

多项选择题 WhichtwocodefragmentswillexecutethemethoddoStuff()inaseparatethread?()

单项选择题 12. String csv = “Sue,5,true,3”;  13. Scanner scanner = new Scanner( csv);  14. scanner.useDelimiter(”,”);  15. int age = scanner.nextInt();  What is the result?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064