public class Application {
public static void main(String[] args) {
// Cateva conditii utile:
System.out.println(5 == 5);
System.out.println(10 != 11);
System.out.println(3 < 6);
System.out.println(10 > 100);
// Folosim loops cu "break":
int loop = 0;
while(true) {
System.out.println("Looping: " + loop);
if(loop == 3) {
break;
}
loop++;
System.out.println("Running");
}
}
}
Output is:
true
true
true
false
Looping: 0
Running
Looping: 1
Running
Looping: 2
Running
Looping: 3