Assume the existence of a Phone class with a method, clear, that clears the phone’s memory– its phone book, list of call, text messages, etc. Assume also, a subclass CameraPhone with an instance variable, album, of type PhotoAlbum–which has a method, also called clear that clears its contents. Override the clear method in CameraPhone to clear the entire phone, i.e., to invoke the clear method of Phone (the superclass), as well as invoking the clear method of the album instance variable.

LANGUAGE: JAVA

CHALLENGE:

Assume the existence of a Phone class with a method, clear, that clears the phone’s memory– its phone book, list of call, text messages, etc. Assume also, a subclass CameraPhone with an instance variable, album, of type PhotoAlbum–which has a method, also called clear that clears its contents. Override the clear method in CameraPhone to clear the entire phone, i.e., to invoke the clear method of Phone (the superclass), as well as invoking the clear method of the album instance variable.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

Leave a Comment

You must be logged in to post a comment.