loading

Non-Primitive Types

Java Non-Primitive Data Types

Because non-primitive data types make references to things, they are also known as reference types.

Primitive and non-primitive data types differ primarily in the following ways:

  • Primitive types are predefined (already defined) in Java. Non-primitive types are created by the programmer and is not defined by Java (except for String).
  • Non-primitive types can be used to call methods to perform certain operations, while primitive types cannot.
  • A primitive type has always a value, while non-primitive types can be null.
  • A primitive type starts with a lowercase letter, while non-primitive types starts with an uppercase letter.

Arrays, Classes, Interfaces, Strings, and so on are instances of non-primitive types. A later chapter will cover these in more detail.

Share this Doc

Non-Primitive Types

Or copy link

Explore Topic