§ Class Slides 7: Control Structures and Exceptions

Class Slides 6: Non-Primitive Data Types
Class Slides 8: Classes and Objects
Home

The following slides discuss various control structures of Java.

Slide 7.1: Decision making
Slide 7.2: The if statement — IfDemo.java
Slide 7.3: The if...else statement
Slide 7.4: The nested if statement
Slide 7.5: The if...else...if ladder
Slide 7.6: The switch statement
Slide 7.7: The switch statement (cont.)
Slide 7.8: The switch statement (cont.): String cases
Slide 7.9: The break statement
Slide 7.10: The continue statement
Slide 7.11: The return statement
Slide 7.12: The while loop — Factorial.java
Slide 7.13: The for loop — ArrayReverse.java
Slide 7.14: The for...each loop
Slide 7.15: Exceptions
Slide 7.16: Exceptions (cont.): The finally keyword
Slide 7.17: Exceptions (cont.): The throw keyword
Slide 7.18: Checked vs unchecked exceptions
Slide 7.19: Checked vs unchecked exceptions (cont.)

☂ Coding Review

Slide 7.a: Two switch statement examples
Slide 7.b: A binary search — BinarySearch.java



      “There are three things all wise men fear:    
      the sea in storm, a night with no moon, and the anger of a gentle man.”    
      ― Patrick Rothfuss, The Wise Man’s Fear