black

SCJP程序员认证考试

登录

单项选择题

class MyThread extends Thread { 
public void run() { System.out.println(“AAA”); } 
public void run(Runnable r) { System.out.println(“BBB”); } 
public static void main(String[] args) { 
new Thread(new MyThread()).start(); 
} 
}  
What is the result?()  

A. AAA
B. BBB
C. Compilation fails.
D. The code runs with no output.

相关考题

单项选择题 WhathappenswhenthreadXexecutesawait()methodonobjectA,withoutowningobjectA’slock?()

单项选择题 public class SyncTest {  private int x;  private int y;  private synchronized void setX( int i ) { x = i; }  private synchronized void setY( int i ) { y = i; }  public void setXY( int i ) { setX(i); setY(i); }  public synchronized boolean check() { return x != y; }  }   Under which condition will check return true when called from a different class? ()

单项选择题 package foo;  public class Outer {  public static class Inner {  }  }   Which statement is true?()

All Rights Reserved 版权所有©PP题库网库(pptiku.com)

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064