Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago