Question
Write java code for the following Using what you have learned about multilevel inheritance and classes design a set of classes with 3 levels of
Write java code for the following
Using what you have learned about multilevel inheritance and classes design a set of classes with 3 levels of inheritance (grandparent, parent, child). These classes should be able to inherit methods and variables between them so make sure they are related. For example (and you may use these examples, but feel free to come up with your own) Organ - grandparent Car - grandparent Restaurant - grandparent Illness - parent Make - parent Menu - parent Symptom - child Model - child Food - child The only one you are NOT allowed to use is geometicObject examples since we did them in class. Protip: it might help for you to draw out a UML diagram so you can think of what functions and variables you want to write ahead of time. You do not have to and you do not have to hand this in, but it will serve you well before you start coding. The following will be the marking scheme which will outline some of the requirements:
1)Implement a grandparent class, a parent class that extends from the grandparent, and a child class that extends from the parent
2)Each class should have at least 2 variables
3)Each class should have at least 2 unique (to that level class) methods, which can be inherited by any subclasses that extend it
4)Each class should have a constructor that sets at least 2 of the variables
5)At least one instance of an overloaded method
6)At least one instance of an overridden method
7)In your tester class show an instance of a class using a method that it inherits from a superclass
8)You will have a tester file, in it you will exercise ALL of your methods across all 3 classes. Your tester should create instances of each class to make sure your functions in each class work, as well as contain the example overloaded, overridden, and your inherited example. It should also compile and run without errors
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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