Biblioteca Java - Blame information for rev 39
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
39 | mihai | 1 | package introducere.java.controlflow; |
4 | mihai | 2 | |
3 | /** | ||
4 | * Exemplify while and do-while structures. | ||
5 | */ | ||
6 | public class WhileStructure { | ||
7 | |||
8 | public static void main(String[] args) { | ||
9 | int count = 1; | ||
10 | while (count < 11) { | ||
11 | System.out.println("xCount is: " + count); | ||
12 | count++; | ||
13 | } | ||
14 | |||
15 | //reset counter and start againg | ||
16 | count = 1; | ||
17 | do { | ||
18 | System.out.println("xxCount is: " + count); | ||
19 | count++; | ||
20 | } while (count <= 11); | ||
21 | } | ||
22 | } |