Non-Primitive Data Types
Reference types are a term used for non-primitive data types since they point to objects.
The primary distinction between primitive and non-primitive data types is:
- Primitive types in Java are pre-defined by the language, whereas non-primitive types, except for String, are created by the programmer and not defined by Java.
- Non-primitive types allow the invocation of methods to execute specific operations, unlike primitive types.
- A primitive type always possesses a value, while non-primitive types can be null.
- Primitive types begin with a lowercase letter, whereas non-primitive types commence with an uppercase letter.
Examples of non-primitive types include Strings, Arrays, Classes, Interfaces, and so forth. Further details about these will be covered in a subsequnt chapter.