Question: JAVA HOMEWORK Question 1: Describing Inheritance Rules In your own words, describe the following: 1.What are the rules for accessing public, private, and protected variables
JAVA HOMEWORK
Question 1: Describing Inheritance Rules
In your own words, describe the following:
1.What are the rules for accessing public, private, and protected variables declared in a parent class from the child class?
2.What are the two uses of the super keyword?
3.When and how do you override a method?
Question 2: Design a Parent/Child Class
Design classes to represent an animal, a dog, and a cat. (Perhaps to be used in a veterinary hospital or pet boarding center). Sketch out the following. (You do not need to write the code.)
What are the parent/child relationships between the classes?
What instance data variables belong in each class (list the name and type)?
What methods would go in each class (list the name, return type, and parameter list)?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
