What is a Data Type:
- It defines what kind of data a variable can store (numbers, text, true/false, etc.)
Types of Data Type:
- Primitive Data Type (Java’s built-in basic types like int, char, and boolean that store single values directly).
- Non Primitive Data Type (They store references (memory addresses) of objects, not the actual value).
1.1: Types of Primitive Data Types/Default Values/Size:
- byte - 0 - 1 byte
- short- 0 - 2 byte
- int - 0 - 4 byte
- float- 0.0- 4 byte
- long - 0 - 8 byte
- double-0.0 - 8 byte
- char - - 2 byte
- boolean- False - 1 byte
2. Types of Non primitive Data Types:
- String - stores text ""
- Array - stores multiple values of the same type.
Top comments (0)