How many types are there in Java?
There are two types of data types in Java: Primitive data types: The primitive data types include boolean, char, byte, short, int, long, float and double.
Java Primitive Data Types.
Data Type | Default Value | Default size |
---|---|---|
short | 0 | 2 byte |
int | 0 | 4 byte |
long | 0L | 8 byte |
float | 0.0f | 4 byte |