Multiple choice

Which of following is not a primitive data type?

  1. boolean

  2. String

  3. int

  4. double

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, primitive data types include byte, short, int, long, float, double, char, and boolean. 'String' is a class (a reference type) rather than a primitive data type, as it represents a sequence of characters and has its own methods.