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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!