Control Flow

Some of the control structures have already been covered. This section discusses all of the control structures in detail.

Blocks

All control statements in SymbEL must have a block associated with them. The block begins with a left curly brace, {, and ends with a right curly brace, }. This convention keeps the grammar clean and provides additional code clarity.

If-Then-Else Statement

The if statement can be an if by itself or an if statement and an else part. The structure of an if construct is:

if (logical expression){
  ... 
}

Two points need to be made about this construct.

The first point is that the condition if checks on cannot be an expression—it must be a logical expression. Therefore, statements such as

 if (running) { ... ...

Get Sun Performance and Tuning: Java™ and the Internet, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.