What are Java's eight primitive data types, and what are their default values and storage sizes?
Java has exactly eight primitive types, and they fall into three groups. The four whole number types are byte at 8 bits, short at 16 bits, int at 32 bits and long at 64 bits. The two types with a fraction are float at 32 bits and double at 64 bits. The last two are char, which holds 16 bits, and boolean, which holds one piece of logical state although the JVM stores it as a byte in practice.
The ranges are worth knowing as well. A byte holds from -128 to 127. A short holds from -32768 to 32767. An int holds roughly plus or minus 2.1 billion.
The default values matter more than most people expect. Every field of a class and every element of an array starts at the zero value of its type. That is 0 for the number types, false for a boolean, and the null character for a char. Local variables are different, because they have no default at all and the compiler will not let you read one before you have given it a value. That difference is on purpose, because it removes a whole family of silent bugs at the source level.
Two size facts get asked again and again. First, an int is always 32 bits and a long is always 64 bits, because the Java language specification fixes those widths. The sizes are not chosen to match the processor underneath. Second, a char is 16 bits because it holds one UTF-16 code unit, which is why a character outside the basic multilingual plane, and many emoji, needs two char values. That matters when you count the characters that a person typed.
One more thing is worth saying. There is no primitive type for decimal money. The class BigDecimal is the correct choice for money, because double and float use binary floating point and cannot hold most decimal fractions exactly.