1Z0-811 Java Basics and Syntax Practice Question
Which data type should be used to store a single character like 'A'?
⚠ Common exam trap
Oracle often tests the distinction between `char` and `String` by presenting a single character literal like 'A' and expecting candidates to recognize that `char` uses single quotes while `String` uses double quotes, leading some to incorrectly choose `String` due to familiarity with text handling.
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
✓
char
In Java, the `char` data type is a single 16-bit Unicode character, capable of storing any character from the Unicode standard, including 'A'. It is the primitive type specifically designed for a single character, whereas `String` is a reference type for sequences of characters.
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
String is for sequences of characters, not single.
- ✓
char
Why this is correct
Correct: char stores a single 16-bit Unicode character.
- ✗
byte
Why it's wrong here
byte stores small integers, not characters.
- ✗
int
Why it's wrong here
int stores integer numbers, not characters.
Go deeper
Related to this question
About these practice questions
This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.