Which of the following is not a primitive data type in java?

Gain Java Knowledge
2 min readMay 22, 2024

Java data types can be divided into two distinct categories: primitive and non-primitive.

There are 8 primitive data types. byte, short, int, long, float, double, boolean, and char.

There are five types of non-primitive data types in Java. They are as follows:

1.Class
2. Object
3. String
4. Array
5. Interface

--

--

Gain Java Knowledge

The Java programming language is one of the most popular languages today. Stay up to date with news, certifications, free learning resources and much more.