IMS-java/src/Grundlagen.java

25 lines
648 B
Java
Raw Normal View History

2023-08-16 14:38:45 +02:00
public class Grundlagen {
2023-08-16 14:52:04 +02:00
public static void main(String[] args) {
System.out.println("Hello World");
int x = 99;
2023-08-16 14:58:36 +02:00
int y = 2;
2023-08-16 14:52:04 +02:00
x = x + 1;
x = x + y;
System.out.println(x);
2023-08-16 14:58:36 +02:00
char myA = 'a';
if (x > 101) {
2023-08-16 15:00:37 +02:00
System.out.println("Der Wert ist grösser als 101");
} else {
System.out.println("Der Wert ist kleiner als 101");
2023-08-16 14:58:36 +02:00
}
2023-08-16 15:04:23 +02:00
int anzahlDurchgaenge = 1;
while(anzahlDurchgaenge <= 5) {
System.out.println("Durchgang nr. " + anzahlDurchgaenge);
anzahlDurchgaenge = anzahlDurchgaenge + 1;
}
2023-08-16 14:38:45 +02:00
}
}