forked from vogellacompany/codeexamples-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester01.java
More file actions
36 lines (30 loc) · 709 Bytes
/
Tester01.java
File metadata and controls
36 lines (30 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package test;
public class Tester01 {
public static void main(String[] args) {
int j = 0;
for (int i = 0; i <= 3; i++) {
System.out.println("i ist " + i);
System.out.println("j ist " + j);
j = j + i;
System.out.println("j ist nach der Addition " + j);
System.out.println("i ist noch " + i);
}
System.out.println("for result " + j);
j = 0;
int i = 0;
boolean check = true;
while (check) {
if (i <= 3) {
System.out.println("i ist " + i);
System.out.println("j ist " + j);
j = j + i;
System.out.println("i ist " + i);
System.out.println("j ist " + j);
} else {
check = false;
}
i++;
}
System.out.println("while brings me " + j);
}
}