BigDog() { super(); this(); }
BigDog() { String name = Fido; super(); }
BigDog() { super(); String name = Fido; }
private BigDog() { super();}
第1题:
1. class BigDog extends Dog { 2. // insert code here 3. } 分别插入到第 2 行,哪二项可以编译?()
第2题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第3题:
BigDog() { super(); this(); }
BigDog() { String name = Fido; super(); }
BigDog() { super(); String name = Fido; }
private BigDog() { super();}
第4题:
只有s1
只有s3
只有s1和s3
只有s1和s4
第5题:
0
1
2
3
第6题:
The application will crash.
The code on line 29 will be executed.
The code on line 5 of class A will execute.
The code on line 5 of class B will execute.
The exception will be propagated back to line 27.
第7题:
2
3
4
0
1
第8题:
0
1
2
3
第9题:
3a行
3b行
3a行或3b行
既非3a,也非3b
第10题:
int gap() { return 7; }
public int gap() { return 7; }
private int gap(int x) { return 7; }
protected Creb gap() { return this; }
public int gap() { return Integer.getInteger (42); }
第11题:
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
int foo() { /* more code here */ }
void foo() { /* more code here */ }
第12题:
int gap() { return 7; }
public int gap() { return 7; }
private int gap(int x) { return 7; }
protected Creb gap() { return this; }
public int gap() { return Integer.getInteger (42); }
第13题:
process(bytes);
BitUtils.process(bytes);
util.BitUtils.process(bytes);
SomeApp cannot use methods in BitUtils.
import util.BitUtils.*; process(bytes);
第14题:
0
1
2
3
第15题:
0
1
2
3
第16题:
this.commission = commission;
superb(); commission = commission;
this.commission = commission; superb();
super(name, baseSalary); this.commission = commission;
super(); this.commission = commission;
this.commission = commission; super(name, baseSalary);
第17题:
0
1
2
3
第18题:
0
1
2
3
第19题:
3a行或3b行
既非3a,也非3b
3a行
3b行