您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Apply Index

Apply Page # 10

Activity 10 – Methods that access an object’s attributes

Looking at the class hierarchy for our library example , list all the superclasses and subclasses, and all the direct superclasses and direct subclasses for classes Recording and CD.

Answer the following questions:

(1) How many direct superclasses do classes Recording and CD have?

(2) How many superclasses do classes Recording and CD have?

(3) How many direct subclasses do classes Recording and CD have?

(4) How many subclasses do classes Recording and CD have?

(5) Explore the JavaDoc JDK documentation

Start up a browser and begin viewing the JavaDoc documentation.

The index.html file should look as similar to the figure below when opened:

Click here to see the image

and starting at the Object class, draw part of the class hierarchy. Write 4 sub-classes at each level, even if there are more, otherwise the exercise could take a long time and a lot of paper! Follow the hierarchy down for 3 levels, with Object as the top level.

Looking through JavaDoc, find a class that has very few subclasses.

(6) Looking again, find a class that has over 7 subclasses.

Discussion of Activity 10 – Methods that access an objects attributes

Back to content

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg