1Z0-811 Arrays and Methods Practice Question
Which two statements about the Arrays class are true? (Choose two.)
⚠ Common exam trap
The 1Z0-811 exam often tests the misconception that `Arrays.binarySearch()` works on any array, but it requires a sorted array; also, candidates may confuse `Arrays.copyOf()` with a deep copy, but it only performs a shallow copy.
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 Arrays class provides a method to fill an array with a specific value.
The `Arrays.fill()` method allows you to assign a specific value to every element of an array, or to a specified range within the array. This is a static utility method provided by the `java.util.Arrays` class, and it works for both primitive and object arrays.
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 Arrays class provides a method to sort only arrays of primitive types.
Why it's wrong here
sort() works on both primitive and object arrays.
- ✓
The Arrays class provides a method to fill an array with a specific value.
Why this is correct
Arrays.fill() sets all elements to the specified value.
- ✗
The Arrays class provides a method to perform binary search on any array.
Why it's wrong here
binarySearch requires a sorted array; 'any array' is not accurate.
- ✗
The Arrays class provides a method to deep copy an array.
Why it's wrong here
Arrays.copyOf() performs shallow copy, not deep copy.
- ✓
The Arrays class provides a method to convert an array to a List.
Why this is correct
Arrays.asList() returns a List backed by the array.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.