Question: (JAVA) Original Code: public class Employee { String name; int age; double salary; public Employee() { } public Employee( String name, int age) { this
(JAVA)
Original Code:
public class Employee { String name;
int age;
double salary;
public Employee() { }
public Employee(String name, int age) { this.name = name;
this.age = age;
}
public Employee(String name, int age, double salary) { this.name = name;
this.age = age;
this.salary = salary;
}
}
write statements that will create 3 objects using each of the constructors specified in the Employee class. You may call the objects emp1, emp2 and emp3. You may choose any appropriate argument values for the overloaded constructors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
