§ 2.7 举 例 例 2.1.下 例 中 用 到 了 前 面 提 到 的 数 据 类 型 ,并 通 过 屏 幕 显 示 它 们 的 值 。 [code lang="php"]public class SimpleTypes{ public static void main( String args[] ){ byte b=0x55; short s=0x55ff; int i=1000000; long l=0xfffL; char c='c'; float f=0.23F; double d=0.7E-3; boolean bool=true; System.out.println("b = "+b); System.out.println("s = "+s); System.out.println("i = "+i); System.out.println("c = "+c); System.out.println("f = "+f); System.out.println("d = "+d); System.out.println("bool = "+bool); } }[/code] 编译并运行该程序,输出结果为: [code lang="php"]C:\>java SimpleTypes b = 85 s = 22015 i = 1000000 l = 4095 c = c f = 0.23 d = 0.0007 bool = true[/code]