Java实现了八种原始数据类型。
public class Main { /** 时代Java - N o w J a v a . c o m 提供 **/ public static void main (String[] args) { boolean BooleanVal = true; /* Default is false */ char charval = 'G'; /* Unicode UTF-16 */ charval = '\u1990'; byte byteval; /* 8 bits, -127 to 127 */ short shortval; /* 16 bits, -32,768 to 32,768 */ int intval; /* 32 bits, -2147483648 to 2147483647 */ long longval; /* 64 bits, -(2^64) to 2^64 - 1 */ float floatval = 1.123456F; /* 32-bit IEEE 754 */ double doubleval = 1.12345678987654;