Java基本数据类型
package test; /* * java中的变量与常量 * */ class Test_1 { public static void main(String args[]) { byte a=127;//byte类型8位 short b=32767;//short类型16位 int c=2147483647;//int类型32位 long d=9223372036854775807L;//long类型64位,数值超过int必须加L,没超过int用long干啥??? float e=1.123456789F;//float类型后面一定加F,有效数字8位 double f=1.1234567890123456; System.out.println(e); System.out.print(f); char ch='a'; System.out.print(ch); } }
图片来源yangfangjit的博客

来源:https://www.cnblogs.com/loneykids/p/11483755.html