O'Reilly logo

Java, A Beginner’s Guide, 5th Edition by Herbert Schildt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Image Chapter 7 Self Test

1. Does a superclass have access to the members of a subclass? Does a subclass have access to the members of a superclass?

2. Create a subclass of TwoDShape called Circle. Include an area( ) method that computes the area of the circle and a constructor that uses super to initialize the TwoDShape portion.

3. How do you prevent a subclass from having access to a member of a superclass?

4. Describe the purpose and use of both versions of super.

5. Given the following hierarchy:

Image

In what order are the constructors for these classes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required