Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

non-primitive
data
type
java

Non-primitive data types in Java

Educative Answers Team

Java is a language that is widely used in the industry of computer science. The specialty of Java is that it provides predefined data types (i.e., primitive data types). These data types have no additional methods attached to them and are pre-defined. The other type of data that Java has is non-primitive data. This data type is provided by the programmer.

svg viewer

Non-primitive data types

There are four​ types of non-primitive data:

  • array: This is a data type used to store data in a consecutive manner. It can store any type of data as the size of the array is also declared by the programmer.

  • String: This is a data type that is used to store consecutive characters or proper sentences (e.g., String abc = "Educative is an excellent tutor";).

  • class: Classes are used to create objects. They are a very well-mannered way of merging different pieces of data into a single object.

  • interface: An interface is like a dashboard or control panel for a class. It has buttons/functions for the data types defined, but the implementation is somewhere else.

RELATED TAGS

non-primitive
data
type
java
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring