Identifying Primitive Data Types in Java
Which TWO of the following are primitive data types in Java?
Quick Answer
double and int both belong to the fixed set of eight primitive types the Java Language Specification defines, but they represent fundamentally different kinds of numbers, which is worth understanding rather than just memorizing the list. int is a 32-bit signed integer, Java's default choice for whole-number values, storing exact values with no fractional component and no rounding behavior to worry about. double is a 64-bit IEEE 754 floating-point type built for decimal values, capable of representing fractional numbers with double precision, though like all floating-point types it carries the well-known caveat that it can't represent every decimal value with perfect exactness, which matters in scenarios requiring precise decimal arithmetic like currency. Recognizing which category a value falls into — a whole number versus something with a fractional or highly precise decimal component — is usually the fastest way to identify the correct primitive type in these exam questions, since Java's eight primitives split cleanly into integer types (byte, short, int, long), floating-point types (float, double), a character type (char), and a boolean type, each occupying a specific role rather than being interchangeable general-purpose numbers.
⚠ Common exam trap
Oracle often tests the distinction between primitive types and their corresponding wrapper classes (e.g., int vs. Integer, boolean vs. Boolean), and the trap here is that candidates confuse the capitalized wrapper class name with the lowercase primitive keyword.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
double
(double) is correct because double is a 64-bit IEEE 754 floating-point primitive data type in Java, used for decimal values with double precision. Option D (int) is correct because int is a 32-bit signed two's complement integer primitive, the default integer type in Java. Both are part of the eight primitive types defined in the Java Language Specification.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
String
Why it's wrong here
Reference type.
- ✗
Integer
Why it's wrong here
Wrapper class.
- ✓
double
Why this is correct
Primitive.
- ✓
int
Why this is correct
Primitive.
- ✗
Boolean
Why it's wrong here
Wrapper class.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-811 question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on 1Z0-811
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which of the following is NOT a primitive data type?
easy- A.int
- B.boolean
- C.char
- ✓ D.String
Why D: String is a class in Java, not a primitive data type. The eight primitive types are byte, short, int, long, float, double, boolean, and char. String is a reference type that stores a sequence of characters as an object.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.