Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

Non-Primitive Data Types

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:

  1. 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.
  2. Non-primitive types allow the invocation of methods to execute specific operations, unlike primitive types.
  3. A primitive type always possesses a value, while non-primitive types can be null.
  4. Primitive types begin with a lowercase letter, whereas non-primitive types commence with an uppercase letter.

Examples of non-primitive types include StringsArrays, ClassesInterfaces, and so forth. Further details about these will be covered in a subsequnt chapter.