Source Code เพื่อ การศึกษา
j0203.java
j0203
// :::: โปรแกรมลำดับที่ 6 // 1. แสดงการใช้คำสั่ง switch, case, default, break // 2. available for switch = char, byte, short or int import java.util.Date; class j0203 { public static void main(String args[]) { byte a = (byte) (new Date().getTime() % 5); switch (a) { case 1: System.out.println("one"); break; case 2: System.out.println("two"); break; default: System.out.println("not found" + a); break; } } }
ปรับปรุงโปรแกรม source.pl : 2553-03-20