KnowledgeBoat Logo

Computer Applications

What is meant by primitive and non-primitive data types? Give an example of each.

Values & Data Types Java

ICSE

35 Likes

Answer

Primitive data types are the basic or fundamental data types used to declare a variable. Examples of primitive data types in Java are byte, short, int, long, float, double, char, boolean.

A non-primitive data type is one that is derived from Primitive data types. A number of primitive data types are used together to represent a non-primitive data type. Examples of non-primitive data types in Java are Class and Array.

Answered By

19 Likes