1   /**
2    * 183.592 Programmierpraxis TU Wien WS2014/15 H.Moritsch
3    * Ausgabe der Zahlenfolge 1, 2, ... , n
4    * äquivalent zu for-Schleife
5    */
6   public class FolgeV1 {
7       public static void main(String[] args) {
8   
9           int n = 10;
10  
11          {                                       // extra Block
12              int zahl = 1;                       // Initialisierung
13  
14              // *solange* zahl kleiner oder gleich n ist: 
15  
16              while (zahl <= n) {                 // Bedingungsausdruck
17  
18                  System.out.println(zahl);       // Anweisung
19  
20                  zahl++;                         // Inkrement
21              }
22          }
23  
24      }
25  }
26