ÀڹٽǽÀ ¿¹Á¦

//IFelse.java class IFelse { public static void main(String args[]) { int month = Integer.parseInt(args[0]); // ½ÇÇà ¸í·É¿¡¼­ »ç¿ëÀڷκÎÅÍ µ¥ÀÌÅ͸¦ ÀÔ·Â¹Þ¾Æ // Á¤¼ö·Î º¯È¯ÇÑ ´ÙÀ½ momth¿¡ ÀúÀå String MtoS; if(month == 12 || month == 1 || month == 2) MtoS = "°Ü¿ï"; else if(month == 3 || month == 4 || month == 5) MtoS = "º½"; else if(month == 6 || month == 7 || month == 8) MtoS = "¿©¸§"; else if(month == 9 || month == 10 || month == 11) MtoS = "°¡À»"; else MtoS = "ÇØ´çµÇ´Â °èÀýÀÌ ¾ø½À´Ï´Ù."; System.out.println( month + " ¿ùÀº " + MtoS + " ÀÔ´Ï´Ù."); } } //Swich.java class Switch { public static void main(String args[]) { for(int i=1; i<5; i++) switch(i) { case 1: System.out.println(i +" : °¡À§ "); break; case 2: System.out.println(i + " : ¹ÙÀ§"); break; case 3: System.out.println(i + " : º¸"); break; default: System.out.println(i + "´Â 1¿¡¼­ 3»çÀÌÀÇ °ªÀÌ ¾Æ´Õ´Ï´Ù."); } } } //NestedForBreak.java class NestedForBreak { public static void main(String args[]) { int i, j; for(i=1 ; i<10 ; i++) { for(j=1 ; j < i ; j++) { if (j > 6) break; System.out.print(" * "); } System.out.println(); } } } //BreakTest.java class BreakTest { public static void main(String args[]) { boolean t = true; first: { second: { third: { System.out.println("third ºí·Ï 'break' ¹®ÀåÀü"); if(t) break second; // second ºí·° ¹ÛÀ¸·Î Á¦¾î°¡ À̵¿ System.out.println("third ºí·Ï 'break' ¹®ÀåÈÄ"); } System.out.println("second ºí·Ï ¹®Àå"); } System.out.println("first ºí·Ï ¹®Àå"); } } } //ContinueLabelTest.java class ContinueLabelTest { public static void main(String args[]) { outer: for (int i=0; i<10; i++) { for(int j=0; j<10; j++) { if(j > i) { System.out.println(); continue outer; // outer·Î ÁöÁ¤µÈ for ºí·Ï óÀ½À¸·Î Á¦¾î À̵¿ } System.out.print(" " + (i * j)); } } } } //Return.java class Return { public static void main(String args[]) { boolean t = true; System.out.println("¾Ë±â ½±°Ô ÇØ¼³ÇÑ ÀÚ¹Ù!"); if(t) return; System.out.println("ÀÚ¹Ù¸¦ ¹è¿öº¾½Ã´Ù."); } }