byte
Occupies 8 bits or 1 byte, which is:
-27 to 27-1 or -128 to 127.
Default value of 0.
short
Occupies 16 bits or 2 bytes, which is:
-215 to 215-1 or -32,768 to 32,767
Default value of 0.
int
Occupies 32 bits or 4 bytes, which is:
-231 to 231-1 or -2,147,483,648 to 2,147,483,647.
Default value of 0.
long
Occupies 64 bits or 8 bytes, which is:
-263 to 263-1 or -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Default value of 0.
. Java
Java Primitive Variables
integers: byte, short, int, long
characters: char
char
Occupies 16 bits or 2 bytes, stores a - z, A - Z, 0 - 9, as well as +, - , etc.
Stores 0 to 216-1 or 0 to 65,535.
Default value '
Occupies 16 bits or 2 bytes, stores a - z, A - Z, 0 - 9, as well as +, - , etc.
Stores 0 to 216-1 or 0 to 65,535.
Default value '