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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!