Site MapHelpFeedbackChapter Summary
Chapter Summary
(See related pages)

  • Aselection control statement is used to alter the sequential flow of control.
  • The if and switch statements are two types of selection control.
  • Aboolean expression contains conditional and boolean operators and evaluates to true or false.
  • Three boolean operators in Java are AND (&&), OR (||), and NOT (!).
  • DeMorgan’s laws state that !(P &&Q) and !P || !Q are equivalent and that !(P || Q) and !P && !Q are equivalent.
  • Logical operators && and || are evaluated by using the short-circuit evaluation technique.
  • Aboolean flag is useful in keeping track of program settings.
  • Anif statement can be a part of the then or else block of another if statement to formulate nested-if statements.
  • Careful attention to details is important to avoid illogically constructed nested-if statements.
  • When the equality symbol == is used in comparing the variables of reference data type, we are comparing the addresses.
  • The switch statement is useful when expressing a selection control based on equality testing between data of type char, byte, short, or int.
  • The break statement causes the control to break out of the surrounding switch statement (note: also from other control statements introduced in Chapter 6).
  • The standard classes introduced in this chapter are
    java.awt.Graphics
    java.awt.Color
    java.awt.Point
    java.awt.Dimension
  • The java.awt.Graphics is used to draw geometric shapes.
  • The java.awt.Color is used to set the color of various GUI components.
  • The java.awt.Point is used to represent a point in two-dimensional space.
  • The java.awt.Dimension is used to represent a bounding rectangle of geometric shapes and other GUI components.







Java3eOnline Learning Center

Home > Chapter 5 > Chapter Summary