Source Code เพื่อ การศึกษา
j0101.java
j0101
// :::: โปรแกรมลำดับที่ 2 // 6 Primitive Data Type class j0101 { public static void main(String args[]) { // 1. boolean true of false boolean b = true; System.out.println("boolean = "+b); // 2. character (2 Byte) char y; y = 'a'; System.out.println("character = "+y); // 3. byte -2^7 to 2^7-1 (1 Byte) byte c; c = 127; System.out.println("byte = "+c); // 4. short -2^15 to 2^15-1 (2 Byte) short a; a = 32767; System.out.println("Short = "+a); // 5. integer -2^31 to 2^31-1 (4 Byte) int x; x = 2147483647; System.out.println("Integer = "+x); // 6. long -2^63 to 2^63-1 (8 Byte) long b; b = 9223372036854775807L; System.out.println("long = "+b); } }
ปรับปรุงโปรแกรม source.pl : 2553-03-20