Question: Use the following segment of Java code to answer the questions: 1. public class Employee implements Person { 2. protected String firstName; 3. protected String

Use the following segment of Java code to answer the questions:

1. public class Employee implements Person {

2. protected String firstName;

3. protected String lastName;

4. public java.util.Date hireDate;

5. public Employee() {}

6. public void setLastName (String l) {}

7. public void setFirstName (String f) {}

8. public void setName (String f, String l) {}

9. public void print() {}

10. }

11. public class SalariedEmployee extends Employee{

12. private String title;

13. private double weeklySalary;

14. public SalariedEmployee(){..}

15. public void setSalEmp (String f, String l){}

16. public void setSalEmp (String f, String l, double s){}

17. public void print(){}

18. }

What object-oriented programming principle is demonstared by lines 1 through 10?

Give the name of the overloaded method(s) in this example.

Give the name of the overridden method(s) in this example.

List the attributes of a SalariedEmployee object:

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!