74.4k views
3 votes
Which of the following is NOT the name of a Java primitive data type?

A. int
B. float
C. double
D. String

User Mattjegan
by
8.8k points

1 Answer

6 votes

Final answer:

The correct answer is D. String. Java primitive data types include int, float, and double. String is not a primitive data type.

Step-by-step explanation:

The correct answer is D. String.

Java primitive data types are the basic building blocks of any Java program, and they include the following:

  • int - used to store whole numbers
  • float - used to store floating-point numbers with single precision
  • double - used to store floating-point numbers with double precision

Although String is a commonly used data type in Java, it is not a primitive data type. It is actually a class in Java's standard library that represents a sequence of characters.

User Gezim
by
8.4k points