Question: Part-2 (Encapsulation, Inheritance, Polymorphism) Create a Java project that demonstrates various object oriented concepts you have learned so far in this course (encapsulation, inheritance and
Part-2 (Encapsulation, Inheritance, Polymorphism) Create a Java project that demonstrates various object oriented concepts you have learned so far in this course (encapsulation, inheritance and polymorphism). To do this, create a super class and at least 2 subclasses. You can either do multilevel inheritance or hierarchical inheritance in this to complete this part-2 task. The super class will have following properties/functionalities a) Create a total of 3 member variables for the class, selecting the appropriate dits types for each field. b) Include an argument constructor in this Class, that will initialize all data fields. c) Encapsulate this Class The two subclasses will have below properties functionalities a) One of the subclasses will have at lemtone member variable and other subclass with at least two member variables b) Have two constructors in each substanse On constructor for initializing only super class data Another constructor will initialize both super and subclass data ) Encapsulate the subclasse di You should include overloaded methods in any of the classes you have created superclass or subclassi c) Overde the toString() method in each of your Cluse Override the equalse) method in canch of your Classes The test dass with the main chal wall perfum below tak 5) Create objects of superclass each subclass types mokinsales and Draw the action form of the object created j schods to fill missing data in att objects Gract outputs Jeannerleading overriding outputs di tre objects subclass and stores in superclass object declared spel Standerton Desting chatadephit scale fruito chining news biodawca of the sed och bla ya Fel dia Sprited for applicat O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
