1. Engineering
  2. Computer Science
  3. add a polymorphism to the staff class with two fuctions...

Question: add a polymorphism to the staff class with two fuctions...

Question details
Add a polymorphism to the staff class with two fuctions called “get score()” and add inheritance to student class in the following code

class Main { public static void main (String[] args) ( Person person1 new Person(); person1.name - John Doe; person1.address-Abuja; System.out.println(person1.name+ +person1.address); Staff staff1 new Staff(Jane Doe,Kano, 2,400) System.out.println(staff1.name+ +staff1.address+ +staff1.staff_Number+ +staff1.salary); Student stud1 new Student(Joe DoeLagos, 3,Computer Sciencetrue); System.out.println(stud1.name+ +stud1.address+ +stud1.studld+ +stud1.department+ +stud1.regStatus);
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution