Question: Implement the following classes using Java: Employee + name: String - salary: double - entryDate: Date + Employee) Employee(name: String, salary:double) + getSalury): double


Implement the following classes using Java: Employee + name: String - salary: double - entryDate: Date + Employee) Employee(name: String, salary:double) + getSalury): double + setSalary(salary:double) void + toString ): String Faculty Staff + rank: String + title: String + Faculty) + Faculty(name:String, salary:donble, rank: String) + toString (): String + Staff) + Staff(name:Strng, salary:double, title:String) + toString (): String Note: The no-arg constructors of the three classes should obtain initial values of data fields from the console. In your main method: 1) Define one object of type Employee, one object of type Faculty, and one object of type Staff using the no-arg constructors of the three classes. 2) Show the details of each object by invoking the toString method and printing the String it returns to the console.
Step by Step Solution
3.49 Rating (169 Votes )
There are 3 Steps involved in it
Class Diagram has 3 classes 1 Employee It is a base class 2 Faculty Subclass of Employee Class In Java we say Faculty class inherits Employee class 3 Staff It is also a Subclass of Employee Class Nota... View full answer
Get step-by-step solutions from verified subject matter experts
