默认值存储需求(字节)取值范围示例
byte01-2^7—2^7-1byte b=10;char‘\u0000’20—2^16-1char c= ‘c’ ;short02-2^15—2^15-1short s=10;int04-2^31—2^31-1int i=10;long08-2^63—2^63-1long o=10L;float0.0f4-2^31—2^31-1float f=10.0Fdouble0.0d8-2^63—2^63-1double d=10.0;booleanfalse1true\falseboolean flag=true;
转载请注明原文地址: https://www.6miu.com/read-55693.html