欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

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.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题