Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertifications1Z0-829TopicsWorking with Arrays and Collections
Free · No Signup RequiredOracle · 1Z0-829

1Z0-829 Working with Arrays and Collections Practice Questions

20+ practice questions focused on Working with Arrays and Collections — one of the most tested topics on the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam. Each question includes a detailed explanation so you learn why the right answer is correct.

Start Working with Arrays and Collections Practice

Exam Domains

Handling Date, Time, Text, Numeric and Boolean ValuesControlling Program FlowUtilizing Java Object-Oriented ApproachHandling ExceptionsWorking with Arrays and CollectionsWorking with Streams and Lambda ExpressionsJava Platform Overview and PackagingAll domains →

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Working with Arrays and Collections Questions

Practice all 20+ →
1.

A developer needs to remove elements from an ArrayList<String> while iterating over it. Which approach is safest and avoids ConcurrentModificationException?

A.for (String s : list) { if (s.equals("x")) list.remove(s); break; }
B.for (int i = 0; i < list.size(); i++) { if (list.get(i).equals("x")) list.remove(i); }
C.Iterator<String> it = list.iterator(); while (it.hasNext()) { if (it.next().equals("x")) it.remove(); }
D.for (String s : list) { if (s.equals("x")) list.remove(s); }

Explanation: Option C is correct because the Iterator's remove() method is the only safe way to remove elements from a collection while iterating, as it updates both the iterator's internal cursor and the collection's modCount, preventing ConcurrentModificationException. The enhanced for-each loop (options A and D) uses an implicit iterator that does not expose a remove method, so calling list.remove() directly modifies the collection without updating the iterator's state, causing the exception. Option B avoids the exception by using an index-based loop, but it is unsafe because removing an element shifts subsequent elements left, causing the loop to skip the next element and potentially miss removals or throw an IndexOutOfBoundsException.

2.

Given: HashSet<String> set = new HashSet<>(); set.add("A"); set.add("B"); set.add("C"); set.add("A"); System.out.println(set.size()); What is the output?

A.Compilation fails
B.3
C.4
D.2

Explanation: Option B is correct because HashSet does not allow duplicate elements. When adding "A" twice, the second add is ignored, so the set contains only three unique elements: "A", "B", and "C". Therefore, set.size() returns 3.

3.

Which interface provides the ability to store key-value pairs and allows null keys?

A.ConcurrentHashMap
B.TreeMap
C.HashMap
D.Hashtable

Explanation: HashMap is the correct answer because it implements the Map interface, allows null keys (only one null key is permitted), and does not synchronize its operations, making it suitable for unsynchronized key-value storage. In contrast, ConcurrentHashMap, TreeMap, and Hashtable all prohibit null keys for various reasons, such as thread-safety guarantees or sorting requirements.

4.

A method returns a List<Integer>. The caller wants to ensure the list cannot be modified. Which is the best approach?

A.return Arrays.asList(list.toArray());
B.return new ArrayList<>(list);
C.return (List<Integer>) list.clone();
D.return Collections.unmodifiableList(list);

Explanation: Option D is correct because `Collections.unmodifiableList()` returns a read-only view of the specified list. Any attempt to modify the returned list (e.g., via `add`, `remove`, `set`) will throw an `UnsupportedOperationException`. This is the standard, recommended approach in the Java Collections Framework to provide an unmodifiable wrapper without copying the underlying data.

5.

Given: TreeSet<Integer> ts = new TreeSet<>(Comparator.reverseOrder()); ts.add(10); ts.add(5); ts.add(20); ts.add(15); System.out.println(ts.first()); What is the result?

A.20
B.15
C.5
D.10

Explanation: Option C is correct because `TreeSet` with `Comparator.reverseOrder()` sorts elements in descending order (20, 15, 10, 5). The `first()` method returns the smallest element according to the comparator, which in descending order is the last element in the natural order, i.e., 5.

+15 more Working with Arrays and Collections questions available

Practice all Working with Arrays and Collections questions

How to master Working with Arrays and Collections for 1Z0-829

1. Baseline your knowledge

Start with 10 questions to gauge your current understanding of Working with Arrays and Collections. This tells you whether you need a concept refresher or just practice.

2. Review every explanation

For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.

3. Focus on exam traps

Working with Arrays and Collections questions on the 1Z0-829 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.

4. Reach 80% consistently

Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.

Frequently asked questions

How many 1Z0-829 Working with Arrays and Collections questions are on the real exam?

The exact number varies per candidate. Working with Arrays and Collections is tested as part of the Oracle Certified Professional Java SE 17 Developer 1Z0-829 blueprint. Practicing with targeted Working with Arrays and Collections questions ensures you can handle any format or difficulty that appears.

Are these 1Z0-829 Working with Arrays and Collections practice questions free?

Yes. Courseiva provides free 1Z0-829 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.

Is Working with Arrays and Collections one of the harder 1Z0-829 topics?

Difficulty is subjective, but Working with Arrays and Collections is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.

Ready to practice?

Launch a full Working with Arrays and Collections practice session with instant scoring and detailed explanations.

Start Working with Arrays and Collections Practice →

Topic Info

Topic

Working with Arrays and Collections

Exam

1Z0-829

Questions available

20+