Chapter 7


Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Appendix C.  Answers to Review Questions


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


Define the class to be abstract.


Define the class to be final.


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.


In the subclass.


In the super class.


The super classes' constructor is called first.


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


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.


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.


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

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: