Question: With the use of Java code fragments, implement the following features of object-oriented paradigm: (i) Inheritance (5 marks) (ii) Polymorphism (5 marks) (iii) A class
With the use of Java code fragments, implement the following features of object-oriented paradigm: (i) Inheritance (5 marks) (ii) Polymorphism (5 marks) (iii) A class to hold student details and calculate student marks. (5 marks) (iv) A statement to instantiate TWO objects of the class defined in Question 2 (iii) above and initiate them with appropriate values. (5 marks)
Step by Step Solution
There are 3 Steps involved in it
i Inheritance Base classclass Person protected String name protected int age public PersonString name int age thisname name thisage age public void di... View full answer
Get step-by-step solutions from verified subject matter experts
