Question 346 of 513
1Z0-829 Working with Arrays and Collections Practice Question
Which THREE statements are true about HashSet in Java 17? (Choose three.)
⚠ Common exam trap
Candidates often confuse HashSet's lack of ordering with the ability to hold duplicates, or assume that 'constant-time performance' means guaranteed O(1) regardless of hash collisions, but the exam expects you to know that it is amortized constant-time under typical conditions.
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
✓
Does not maintain insertion order
HashSet is backed by a HashMap, which uses hash codes to store elements in buckets. The iteration order depends on the hash values and bucket distribution, which can change when the set is resized, so insertion order is not preserved.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Does not maintain insertion order
Why this is correct
Order is not guaranteed.
- ✗
Allows duplicate elements
Why it's wrong here
No duplicates allowed.
- ✗
Is thread-safe
Why it's wrong here
Not synchronized.
- ✓
Has constant-time performance for basic operations
Why this is correct
Average O(1) for add, remove, contains.
- ✓
Allows at most one null element
Why this is correct
HashSet permits null.
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 25, 2026
This 1Z0-829 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-829 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.