Question: For Employee.java: 1 . Create the three attributes of the Employee class ( id , name, and salary ) as private fields as private fields.
For Employee.java:
Create the three attributes of the Employee class id name, and salary as private fields as private
fields.
Create accessors and mutators for all three attributes.
Create a default constructor no parameters! for the Employee class that initializes the Employee
objects name field to TBD and salary field to id should not be initialized yet
Create an overloaded constructor for the Employee class accepts a String name and double salary as its
parameters and initializes your name and salary attributes to the values passed in id should not be
initialized yet Test that both of your constructors work before moving on
Write a print method that prints an employee objects information as follows:
Employee ID:
Name: Alice
Salary: $
Note the $ : and spacing. Trailing decimals for salary is ok
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
