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 what condition you're in after studying conditional statements in Java.

Questions

  1. Conditional tests result in either a true or false value. Which variable type does this remind you of?
    1. None. They're unique.
    2. The long variable type.
    3. The boolean type.
  2. Which statement is used as a catch-all category in a switch block statement?
    1. default
    2. otherwise
    3. onTheOtherHand
  3. What's a conditional?
    1. The thing that repairs messy split ends and tangles after you shampoo.
    2. Something in a program that tests whether a condition is true or false.
    3. The place where you confess your sins to a neighborhood religious figure.

Answers

  1. c. The boolean variable type can only equal true or false, making it similar to conditional tests.
  2. a. default statements will be handled if none of the other case statements matches the switch variable.
  3. b. The other answers describe conditioner and a confessional.

Share ThisShare This

Informit Network