Data types are used to represent type of the variable & expressions.
Representing how much memory is allocated for variable.
Specifies range value of the variable.
| There are 8 primitive data types in java |
| Data Type | size(in bytes) | Range | default values |
| byte | 1 | -128 to 127 | 0 |
| short | 2 | -32768 | 0 |
| int | 4 | -2147483648 to 2147483647 | 0 |
| long | 8 | 9,223,372,036,854,775,808 to 9 ,223,372,036,854,775,807 | |
| float | 4 | -3.4e38 to 3.4e | 0.0 |
| double | 8 | -1.7e308 to 1.7e308 | 0.0 |
| char | 2 | 0 to 6553 | single space |
| Boolean | no-size | no-range | false |