Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Quiz

To determine what kind of knowledge you inherited from the past hour's work, answer the following questions.

Questions

  1. If a superclass handles a method in a way you don't want to use in the subclass, what can you do?
    1. Delete the method in the superclass.
    2. Override the method in the subclass.
    3. Write a nasty letter to the editor of the San Jose Mercury News hoping that Java's developers will read it.
  2. Which of the following is not a benefit of JavaBeans?
    1. Objects can be shared easily with other programmers.
    2. A Bean can be used with any development tool that supports the standard.
    3. They cause emissions that violate stringent air quality standards in most countries.
  3. What statement can you use to refer to the methods and variables of the current object?
    1. this
    2. that
    3. theOther

Answers

  1. b. Because you can override the method, you don't have to change any aspect of the superclass or the way it works.
  2. c. You're thinking of an entirely different type of bean. This question is dedicated to my father, who is prohibited by local statute from eating Ranch Style Beans in a poorly ventilated environment.
  3. a.

Share ThisShare This

Informit Network