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

Hour 7: Using Conditional Tests to Make Decisions

Online Interactive Learning Lab

How to create the Clock application.

Hour 7 Quiz

Question 1. Conditional tests result in either a true or false value. Which variable type does this remind you of?

1.a. None. Stop pestering me with all these questions

1.b. The long variable type

1.c. The boolean type

The boolean variable type only can equal true or false, making it similar to conditional tests. If you answered a., I'm sorry, but there's only 17 hour left and we've got a lot left to cover. Java doesn't teach itself.

Question 2. Which statement is used as a catch-all category in a switch block statement?

2.a. default

2.b. otherwise

2.c. onTheOtherHand

default statements are handled if none of the other case statements matches the switch variable.

Question 3. What's a conditional?

3.a. The thing that repairs messy split ends and tangles after you shampoo

3.b. Something in a program that tests whether a condition is true or false

3.c. The place where you confess your sins to a local religious figure

The other answers describe conditioner and a confessional.

Notes and Corrections

  • None.

Source Files

Reader Questions

  • None.

Activities

  • Solution 1: Every break statement that is removed from Clock.java may cause an extra month name to be displayed, depending on the statement that was removed and the current month. Edit
  • Solution 2: NoteGrade1.java and NoteGrade2.java. Edit
   
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!