Question 139 of 481
1Z0-811 Arrays and Methods Practice Question
Which of the following is not a valid array variable declaration in Java?
⚠ Common exam trap
Oracle often tests the distinction between array declarations and primitive variable declarations, trapping candidates who think `int arr;` is a valid array declaration because they overlook the missing brackets.
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
✓
int arr;
`int arr;` declares a simple integer variable, not an array. In Java, an array variable declaration must include square brackets ([]) to indicate the variable is an array type. Without brackets, the variable is a primitive or reference type, not an array.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
int arr;
Why this is correct
`int arr;` declares a primitive integer variable, not an array. For a variable to be declared as an array in Java, the square brackets `[]` must be present, either immediately following the type (e.g., `int[] arr;`) or after the variable name (e.g., `int arr[];`). Without these brackets, the declaration specifies a single `int` value, satisfying the question's requirement for an invalid array variable declaration.
- ✗
int[] arr[];
Why it's wrong here
Valid: declares a 2D array.
- ✗
int[] arr;
Why it's wrong here
Valid: declares an array of ints.
- ✗
int arr[];
Why it's wrong here
Valid: another syntax for array declaration.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.