I don't have one.
The size of the variable is all objects except for the primary type. So it's an object, so it's a pointer to the variable c that points to the object. This size is the same, meaningless.
Below is the size of the primary type.
System.out.println("byte: " + Byte.BYTES);
System.out.println("char: " + Character.BYTES);
System.out.println("int: " + Integer.BYTES);
System.out.println("long: " + Long.BYTES);
System.out.println("short: " + Short.BYTES);
System.out.println("double: " + Double.BYTES);
System.out.println("float: " + Float.BYTES);
byte: 1
char: 2
int: 4
long: 8
short: 2
double: 8
float: 4
In Java, the array has .length and each collection (List, Map, etc.) is given a size method.
© 2024 OneMinuteCode. All rights reserved.