Data types specify the type of data that a variable can store. Java supports several primitive data types, including int, float, double, char, boolean, etc. These are used to store simple values. Additionally, Java supports reference data types, such as arrays, objects, and classes.
Data Type | Name of Data Type | Description |
---|---|---|
Primitive | int, float, char, boolean | Holds a single value of a specific type |
Non-primitive | String, Object,Array,Class | Holds a collection of values or objects |