Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Belajar Switch Case di Java
class BelajarSwitchCase
{
public static void main(String[] args) {
int pilihan = 5;
switch(pilihan) {
case 1: System.out.println("Selamat Anda menemukan HP!");
break;
case 2: System.out.println("Selamat Anda menemukan Pensil!");
break;
case 3: System.out.println("Selamat Anda menemukan Spidol!");
break;
default: System.out.println("Gelas itu ngga ada!");
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.