r/javahelp • u/Saivy__4 • Feb 07 '20
Need Help with Abstract Classes!
abstract class Employee {
private int id;
private String firstName;
private String lastName;
public Employee(int id, String firstName, String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
abstract double calculatePay();
}
Employee class – This class has the following characteristics a. Must be abstract b. Three data fields i. id: int (greater than 0)
ii. firstName: String
iii. lastName: String
c. Only one constructor, namely a 3-arg constructor setting the above
d. Getters and Setters for the above
e. An abstract calculatePay method with no parameters that returns a double
f. Overrides the toString() method of Object making it abstract
Im not able to understand (F) part or last part. Any hints will be greatly appreciated.
Thank You
17
Upvotes
1
u/[deleted] Feb 07 '20 edited Jan 08 '25
abounding stocking marble towering pet attraction lock snow insurance obtainable
This post was mass deleted and anonymized with Redact