Created
October 8, 2012 04:38
-
-
Save rawaludin/3850747 to your computer and use it in GitHub Desktop.
Belajar Switch Case pake IF di Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BelajarSwitchCasePakeIf | |
{ | |
public static void main(String[] args) { | |
int pilihan = 5; | |
if (pilihan==1) { | |
System.out.println("Selamat Anda menemukan HP!"); | |
} else if (pilihan==2) { | |
System.out.println("Selamat Anda menemukan Pensil!"); | |
} else if (pilihan>=3) { | |
System.out.println("Selamat Anda menemukan Spidol!"); | |
} else { | |
System.out.println("Gelas itu ngga ada!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment