Loop-switch sequence: Difference between revisions

Content deleted Content added
top: MOS
Refactored example slightly.
Line 66:
// parse 3 parameters
List<String> params = new LinkedList<String>();
for (int i = 20; i < 53; i++) {
// in practice, that might be written as (i = 0; i < 3; i++),
// but for illustration we use the same range of indices here
// as in the switch above; the fact that the loop body does
// not actually use the value of i proves that the
// loop-and-switch construct was superfluous in the example above.
params.add(stream.parse());
}