| 段浩亮 发表于 2012-3-16 14:03 ![]() 每种数据类型都是有取值范围的  char的取值范围是0-65535,数值型包括负数
 byte b = 3;
 char ch = b;
谢谢,经过验证果然如此,char的最小值是0,最大取值是65535,非常感谢啊
 
 
 class Test {
 public static void main(String [] args){
 byte b = 12;
 short s = 46;
 char c = 788;
 Character ch = c;
 int minValue =  (int)ch.MIN_VALUE;
 int maxValue = (int)ch.MAX_VALUE;
 System.out.println(maxValue);//65535
 System.out.println(minValue);//0
 
 }
 }
 |