ECLIPSE - JAVA
public class Main {
public static void main(String[] args) {
int x = 8;
if (1 == x) {
System.out.println("Hello 1");
}
if (1 == x) {
System.out.println("Hello 2");
} else {
System.out.println("Apa kabar 1");
}
if (1 == x) {
System.out.println("Hello 3");
} else if (x > 5) {
System.out.println("Apa kabar 2");
}
int a = 1;
switch (a) {
case 0:
System.out.println("a bernilai nol");
break;
case 1:
System.out.println("a bernilai satu");
break;
case 2:
System.out.println("a bernilai dua");
break;
case 3:
System.out.println("a bernilai tiga");
break;
default:
System.out.println("a bernilai lain");
break;
}
}
}
No comments:
Post a Comment