Basic HTML version of Foils prepared 18 May 97

Foil 20 Java Language -- Control Flow I

From Java Tutorial - Spring 1997 Part II: Java Language and Object-Oriented Concepts Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


1 if(some boolean expression) { .. }
2 else if(another boolean) { .. }
3 else { ... }
4 while(any boolean) { /* Do Stuff */ }
5 do { /* What to do */ } while(another boolean);
6 for(expression1; booleanexpression ; expression2) { ...}
7 naturally starts with expression1, applies expression2 at end of each loop, and continues as long as booleanexpression true
8 switch (expression) { /* Just as in C */
9 case Constant1: /* Do following if expression=Constant1 */
10 /* Bunch of Stuff */
11 break;
12 case Constant2: /* Do following if expression=Constant2 */
13 /* Bunch of Stuff */
14 break; /* ....... */
15 default:
16 /* Bunch of Stuff */
17 break;
18 }

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 Thu Jan 8 1998