-->
当前位置:首页 > 题库

单选题:Given the following code how could you invoke the Base construct

Luz5年前 (2021-05-10)题库964
Given the following code how could you invoke the Base constructor that will print out the string "base constructor";
```Java
class Base{
Base(int i){ System.out.println("base constructor"); }
}
public class BaseSup extends Base{
public static void main(String argv[]){
BaseSup s= new BaseSup();
//One
}
BaseSup(){
//Two
}
}
```
@[C](2)

A. At the line after //One put `Base(10);` 

B. At the line after //One put `super(10);` 

C. At the line After //Two put `super(10);`

D. At the line After //Two put `this (10);`





A.At the line after //One put `Base(10);`
B.At the line after //One put `super(10);`
C.At the line After //Two put `super(10);`
D.At the line After //Two put `this (10);`


答案:C