1Z0-811 Primitives, Strings and Operators Practice Question
Which two statements are true about primitive data types in Java?
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
✓
The long data type can store values from -2^63 to 2^63-1.
Options A and B are correct. The long data type is 64-bit with a range from -2^63 to 2^63-1. The short data type is 16-bit with a range from -32,768 to 32,767. Option C is false because the float data type is 32-bit and cannot represent decimal numbers precisely; it is an approximate type. Option D is false because the boolean data type's size is not strictly defined; it is typically represented as a byte or word, not a single bit. Option E is false because the char data type stores Unicode characters (16-bit) and can represent a wide range of characters beyond ASCII.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The long data type can store values from -2^63 to 2^63-1.
Why this is correct
Correct: long is 64-bit signed two's complement.
- ✓
The short data type can store values from -32,768 to 32,767.
Why this is correct
Correct: short is 16-bit signed two's complement.
- ✗
The float data type is 32-bit and can represent decimal numbers precisely.
Why it's wrong here
False: float is not precise; use double or BigDecimal for precision.
- ✗
The boolean data type has a size of 1 bit.
Why it's wrong here
False: boolean size is JVM-dependent and typically 1 byte.
- ✗
The char data type can store only ASCII characters.
Why it's wrong here
False: char stores Unicode characters (0 to 65535).
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 →
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.