Java Programming   Java Programming
 |Sofia Home | Content Gallery |
Home
Syllabus
Schedule
Lessons
Assignments
Resources

Lesson 5 - Selection

From 2001's HAL to War Games' WOPPER to AI, popular culture has often portrayed computers as "thinking machines", rather than as glorified calculators. Computers seem to "think" because, unlike an adding machine, a computer can make decisions and carry out different actions, based upon the input it receives. That's the subject of this lesson.

Lesson 5 sections are as follows:

5.1 The boolean Type

Learn about the boolean primitive data type.

5.2 The if Statement

Learn how to perform selection using if, else, and the relational operators.

5.3 Logical Operators Learn how to use AND, OR, and NOT, and the rules of short-circuit evaluation.
5.4 Multiple Choice

Learn how to implement multi-way branches using if-else-if-else, as well as switch.

5.5 Java "action" Events

Learn to handle button-clicks the Java 1.0 way, by using the action() method.

5.6 Panels and Layout

Learn about Java's Panel class and the different layout managers.

Continue with section 5.1 The boolean Type

Back to Top
Content Developed by Stephen Gilbert, Licensed under a Creative Commons License
Published by the Sofia Open Content Initiative
© 2004 Foothill-De Anza Community College District &The William and Flora Hewlett Foundation