Created
March 8, 2014 15:33
-
-
Save gunungloli666/9433567 to your computer and use it in GitHub Desktop.
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class TestLoop { | |
static BufferedReader bufferRead = new BufferedReader( | |
new InputStreamReader(System.in)); | |
public static void main(String[] args) throws IOException { | |
A: while (true ) { | |
System.out.println("MASIH INGIN BERMAIN..??, ketik y"); | |
String s = bufferRead.readLine(); | |
if(s.equalsIgnoreCase("Y")){ | |
B: while(true){ | |
System.out.println("MASUKKA ANGKANYA.. !!"); | |
String ss = bufferRead.readLine(); | |
try{ | |
Integer a = Integer.parseInt(ss); | |
if(a > 5){ | |
System.out.println("a > 5"); | |
continue B; | |
}else{ | |
System.out.println("a < 5"); | |
} | |
System.out.println("jika a < 5 , INI dieksekusi.. "); | |
}catch(NumberFormatException ee ){// jika bukan angka Integer yang dimasukkan | |
continue A; | |
} | |
} | |
}else{ | |
break A; | |
} | |
} | |
System.out.println("MAKASIH..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment