Basic HTML version of Foils prepared Sept 6 1998

Foil 12 Java Language -- Control Flow II

From Java Tutorial 98-2: Java Language and Object Oriented Techniques CPS606 Fall Semester 1999 -- Sept 7 1999. by Geoffrey C. Fox, Nancy McCracken


1 switch (expression) /* Just as in C */
  • {
  • case Constant1: /* Do following if expression=Constant1 */
    • /* Bunch of Stuff */ break;
  • case Constant2: /* Do following if expression=Constant2 */
    • /* Bunch of Stuff */ break;
  • default:
    • /* Bunch of Stuff */ break;
  • }
2 One can go to the next iteration of a loop by using
  • continue;
3 or break out of the loop by using
  • break;

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Sep 6 1999