Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Quiz

The following questions will see if you have the attributes and behavior to understand object-oriented programming techniques.

Questions

  1. In a Java class, a method is an example of what?
    1. Attributes
    2. Statements
    3. Behavior
  2. If you want to make a variable a class variable, what statement must you use when it is created?
    1. new
    2. public
    3. static
  3. What is the name for the part of a program in which a variable lives?
    1. Its nest
    2. The scope
    3. Variable valley

Answers

  1. c. A method is made up of statements, but it's an example of behavior.
  2. c. If the static statement is left off, the variable will be an object variable instead of a class variable.
  3. b.

Share ThisShare This

Informit Network