对于下例代码,下面叙述正确的是()。 class Person { Person(int m){ } } class Student extends Person { }
A、可以用Person类的无参数构造方法创建对象:new Person()。
B、可以用Student类的无参数构造方法创建对象:new Student()。
C、代码无法通过编译。
D、Person类不能创建对象。
A、可以用Person类的无参数构造方法创建对象:new Person()。
B、可以用Student类的无参数构造方法创建对象:new Student()。
C、代码无法通过编译。
D、Person类不能创建对象。
A、Person Student
B、Person Person
C、Student Student
D、Student Person
A、backward integration.
B、forward integration.
C、taper integration.
D、related diversification.
E、unrelated diversification.
A、int MAX=100; 会导致编译出错。
B、public void stop(); 会导致编译出错。
C、protected void start(); 会导致编译出错。
D、abstract void pause(); 会导致编译出错。
A、编译错误
B、无输出结果
C、I'm a bird.
D、I'm an animal. I'm a bird.
A、i = m;
B、i = b;
C、i = p.a;
D、i = p.change(30);
private int num;
private boolean isComplete;
private int result;
public Computation(int num) { this.num = num; }
public synchronized void run() {
result = num * 2;
isComplete = true;
notify();
}
public synchronized int getResult() {
while (!isComplete) {
try {
wait();
} catch (InterruptedException e) { }
}
return result;
}
public static void main(String[] args) {
Computation[] computations = new Computation [4];
for (int i = 0; i< computations.length; i++) { computations[i] = new Computation(i); computations[i] .start(); } for (Computation c : computations) System.out.print(c.getResult() +“ “); } } What is the result?()
A. The code will deadlock.
B. The code may run with no output.
C. An exception is thrown at runtime.
D. The code may run with output “0 6”.
E. The code may run with output “2 0 6 4‟.
F . The code may ruin with output “0 2 4 6”.
A、Name
B、name
C、age
D、SaySomething
B、obj2.show1();
C、obj3.show1();
D、obj2.show2();
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!