Question: Define a Java class namely Employee containing: Instance variables: - id: A private instance variable of type integer. - name: A private instance variable of

Define a Java class namely Employee containing: Instance variables: - id: A private instance variable of type integer. - name: A private instance variable of type String. - salary: A private instance variable of type double. - workedHour: A private instance variable of type double. Methods: - full-parameterized constructor: a constructor method to initialize the instantiated objects.

setname( xxx ): acts as the set method for the attribute name - setid(xxx): acts as the set method for the attribute id - setsalary(xxx): acts as the set method for the attribute salary - setworkedHour(xxx): acts as the set method for the attribute workedHour. - getname (): acts as the get method for the attribute name - getid (): acts as the get method for the attribute id - getsalary (): acts as the get method for the attribute salary - getworkedHour (): acts as the get method for the attribute workedHour. - display(): print the attributes id, name, and salary in the following format: id" ,"name", "salary".

Define a Java class TestEmployee that contains a main method and test the functionality of the above class Employee - Create three objects of type Employee

Define a Java class namely Employee containing: Instance variables: - id: A

Name of object id name workedHour salary El 1001 Mohammed 44 2000 E2 1002 Omar 38 4000 E3 1003 Khaled 45 5400

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!