Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started