代码练习
byte b =127;//范围-128至127 short s = 2; int j = 123; long l = 1234L;//后面标记L确定为long型 int c = (int)1234l;//强制转换,显示转换 long ll = b; float f = 123.45f;//需要在数字末尾加“f”标记 double d =12345; f = (float)d;//强制转换,必须是相关数据类型才可以转换 f = l; char v ='a';//单引号‘’引起来你的单个字符 int a = v; System.out.println("a =" +a); char g = 98; System.out.println("g =" +g);//ASCII码 //UTF-8 boolean t = true; //逻辑真,true和false都是小写 t = false;//逻辑假