Chapter 7

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Appendix C.  Answers to Review Questions


A1:

Overriding a method in a subclass means that you provide a new implementation for an existing method in the super class.

A2:

Define the class to be abstract.

A3:

Define the class to be final.

A4:

Polymorphism literally means "many shapes" and refers to one object being used in multiple differing ways. In Java it is implemented by referencing a class instance by its base class or through an interface (next chapter) so that the specific implementation of a class does not matter when programming against it.

A5:

In the subclass.

A6:

In the super class.

A7:

The super classes' constructor is called first.

A8:

The keyword super allows you to reference your class's super class's methods directly from within your class.

A9:

The super() method calls the super class's constructor and is useful for calling a specific constructor that you want executed before your class is constructed.

A10:

If you want your super class's finalize() method called, you must explicitly call it from your class's finalize() method; note that you must call it after you have completed finalizing your class.


       
    Top
     



    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net