Owl Teach Yourself Java in 24 Hours, Fifth Edition
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS
ROGERS CADENHEAD

Hour 12: Making the Most of Existing Objects

Online Interactive Learning Lab

How to create the Point3D class and test it with the PointTester application.

Hour 12 Quiz

Question 1. If a superclass handles a method in a way you don't want to use in the subclass, what can you do?

1.a. Delete the method in the superclass

1.b. Override the method in the subclass

1.c. Write a nasty letter to the editor of the San Jose Mercury News hoping that Java's developers read it

Because you can override the method, you don't have to change any aspect of the superclass or the way it works.

Question 2. What methods can be used to retrieve an element stored in a vector?

2.a. get()

2.b. read()

2.c. elementAt()

The get() method has one argument, the index number of the element.

Question 3. What statement can you use to refer to the methods and variables of a current object?

3.a. this

3.b. that

3.c. theOther

The this keyword refers to the object in which it appears.

Notes and Corrections

  • Pages 166-167: If you have trouble getting NetBeans to run an application with arguments, run the program by choosing Run, Run Project or hitting the F6 key. Edit

Source Files

Reader Questions

  • None.

Activities

   
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS

Search terms used to find this page: Java programming, teach yourself, 24 hours, how to, learn, Sams, Macmillan, Java2, JDK1.5, Java 1.5, JDK 1.5, SDK1.5, Java 2 SDK 1.5, SDK 1.5, Java 2 version 1.5, J2SE 1.5, J2SE 5, Java 2 Standard Edition 1.5, Java 2 Standard Edition 5, Java 2 SDK, Java SDK, Rogers Cadenhead, tutorial, hands-on, source code, code, javac, java, appletviewer, help, learning, applet, application, Java Plug-in, plugin, Swing, GUI, interface, Java2D, IO, Java Web Start, games, novice, beginner, neophyte, rookie

Valid HTML 4.01!

Valid CSS!