Question: Write an abstract class called Staff Member that has two protected String fields called name and phone, and it also has a two argument constructor
Write an abstract class called Staff Member that has two protected String fields called name and phone, and it also has a two argument constructor that sets those two fields. Don't worry about creating getters and setters for those field values, but you must create a to String method that returns a String with the two values. And include an abstract method in this class called pay () that returns a double. After writing that class, write another class called Volunteer, which inherits from the Staff Member class and has no additional fields. The Volunteer class has a two argument constructor that sets the two field values of its parent class, and it has a pay() method that just returns the value of zero, and it has a to String() method that returns the String "Volunteer: " followed by what the toString() method of the parent class returns
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
