Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started