JAVA中每个类型占用多少字节
程序员文章站
2023-12-30 22:52:16
public static void main(String[] args) { System.out.println((Byte.SIZE) / 8);//1 System.out.println((Integer.SIZE) / 8);//4 System.out.println((Short.... ......
public static void main(string[] args) { system.out.println((byte.size) / 8);//1 system.out.println((integer.size) / 8);//4 system.out.println((short.size) / 8);//2 system.out.println((long.size) / 8);//8 system.out.println((float.size) / 8);//4 system.out.println((double.size) / 8);//8 system.out.println((character.size) / 8);//2 }