Make a java program thatdo the following: Make a super class named employee which has three attributes
Fantastic news! We've Found the answer you've been seeking!
Question:
Make a java program thatdo the following:
- Make a super class named employee which has three attributes name, age and salary and a method named printData that prints name, age and salary of an employee.
- Provide two classes named programmer and database specialist (DatabasePro).
- Each one of these classes extends the class employee.Both classes; programmer and the DatabasePro inherit the fields name, age and salary from employee.For the programmer, we add a language attribute and for the specialist (DatabasePro), we add a database tool attribute.
- Each one of these classes has only the method printData(). This method prints the data of the employee (i.e., name, age and salary by invoking printData() in super class) as well as printing the special data for programmer( i.e., language) and for DatabasePro( i.e.,databaseTool).
- Provide a class Main that Makes programmer and database specialist then initialize and print their respective information.
Typical runs of the program
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: