多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

public class Starter extends Thread {  private int x= 2;  public static void main(String[] args) throws Exception {  new Starter().makeItSo();  }  public Starter() {  x=5;  start();  }  public void makeItSo() throws Exception {  join();  x=x- 1;  System.out.println(x);  }  public void run() { x *= 2; }  }  What is the output if the main() method is rum?() 

  • A、 4
  • B、 5
  • C、 8
  • D、 9
  • E、 Compilation fails.
  • F、 An exception is thrown at runtime.
  • G、 It is impossible to determine for certain.
正确答案:D
答案解析:
进入题库查看解析

微信扫一扫手机做题