Last active
August 29, 2015 14:15
-
-
Save up1/23b3cda02482eb1d3c2b to your computer and use it in GitHub Desktop.
If-Else
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
if (x < 0) { | |
throw new Exception("ข้อมูลไม่สามารถติดลบได้นะ"); | |
} else { | |
System.out.println("แจ่ม ทำงานได้"); | |
} |
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
if (x < 0) { | |
System.out.println("ค่าน้อยกว่าศูนย์"); | |
} else { | |
System.out.println("แจ่ม ทำงานได้"); | |
} |
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
if (x < 0) { | |
throw new Exception("ข้อมูลไม่สามารถติดลบได้นะ"); | |
} | |
System.out.println("แจ่ม ทำงานได้"); |
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
if (x < 0) { | |
throw new Exception("ข้อมูลไม่สามารถติดลบได้นะ"); | |
exit(); | |
} |
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
for(int x : numbers){ | |
if (x < 0) { | |
continue; | |
} | |
System.out.println("แจ่ม ทำงานได้"); | |
} |
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
for(int x : numbers){ | |
if (x >= 0) { | |
System.out.println("แจ่ม ทำงานได้"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment