中国大学MOOC: 设有语句Employee A = new Employee( );,则语句中的第二个Employee代表( )。
举一反三
- 设有语句Employee A = new Employee( );,则语句中的第二个Employee代表( )。 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()
- 有如下类的定义,创建Employee对象正确的是() public class Employee{ private int age; private String name; public void Employee(){ } public Employee(int age){ this.age = age; } public Employee(String name){ this.name = name; } } A: Employee e = new Employee( ) B: Employee e = new Employee(10); C: Employee e = new Employee(tom); D: Employee e = new Employee(10,"tom");
- 有如下类的定义,创建Employee对象错误的是() public class Employee{ private int age; private String name; public Employee(int age){ this.age = age; } public Employee(String name){ this.name = name; } public Employee(int age,String name){ this(age); this.name = name; } } A: Employee emp = new Employee(10); B: Employee emp = new Employee("Tom"); C: Employee emp = new Employee(); D: Employee emp = new Employee(10,"Tom");
- 中国大学MOOC: The new employee wishes the others the computer with him.