• 2022-06-01
    有如下类的定义,创建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");
  • 举一反三