题目内容

阅读程序public class Test{public Test(){system.out.println("构造方法一被调用");}pulbic Test(int x){this();system.out.println("构造方法二被调用");}public Test(boolean n){this(1);system.out.println("构造方法三被调用");}public static void main(String[] args){Test test = new Test(true);}

A. 构造方法一被调用
B. 构造方法二被调用
C. 构造方法三被调用
D. 以上三个选项和

查看答案
更多问题

在类的继承关系中,需要遵循以下如个继承原则?

A. 多重
B. 单一
C. 双重
D. 不能继承

已知:class Employee;class Manager extends Employee;class Director extends Employee;则以下语句能通过编译的有哪些?

A. Employee e = new Manager();
B. Director d = new Manager();
C. Director d = new Employee();
D. Manager m = new Director()

要产生【20,999】之间的随机整数可以使用以下哪个表达式?

A. (int )(20+Math.random()*97)
B. 20+(int)(Math.randow() * 980)
C. (int)Math.random() * 999
D. 20 + (int)Math.random() * 980

下面哪一个是窗口正在关闭事件处理方法()

A. windowClosing
B. windowClosed
C. windowDeactivated
D. windowDeiconified

答案查题题库