Primitive Types
- There are a total of 8 primitive types predefined and provided.
- As they have default values, they do not have Null.
- They are stored in the stack memory, which is the space for storing actual values.
- String is an object and not a primitive type.
Reference Types
- All types except primitive types are reference types.
- Null, which represents an empty object, exists in reference types.
- The space for storing the address value of the location where the value is stored is in the heap memory.
- There are no syntax errors, but runtime errors occur when using Null for objects or arrays, leading to a NullPointException. Therefore, variables should be assigned values.
댓글 없음:
댓글 쓰기