September 2005
Beginner
576 pages
13h 6m
English
One of the more annoying punishments for schoolchildren is to make them write something over and over again on paper or a chalkboard.
On The Simpsons, in one of his frequent trips to the board, Bart Simpson had to write, “I will not obey the voices in my head” dozens of times. This kind of punishment might work on children, but it definitely would fail to be punitive to a computer, which can repeat a task with ease.
Computer programs are ideally suited to do the same thing over and over again because of loops. A loop is a statement or set of statements that will be repeated in a program. Some loops take place a fixed number of times. Others take place indefinitely.
There are three loop statements in Java: ...
Read now
Unlock full access