Tagged articles
10 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 20, 2023 · Fundamentals

Understanding Java List.remove Overloads and the Pitfalls of Arrays.asList

This article explains the overloaded remove methods in Java's List interface, demonstrates common mistakes when removing elements from ArrayList, clarifies the behavior of Arrays.asList with primitive arrays versus object arrays, and highlights related issues such as unsupported add/remove operations and index‑based deletions.

ArrayListArrays.asListJava
0 likes · 10 min read
Understanding Java List.remove Overloads and the Pitfalls of Arrays.asList
MaGe Linux Operations
MaGe Linux Operations
Jan 19, 2022 · Fundamentals

Master Python List Deletion: remove, pop, and del Explained

Learn how to delete elements from Python lists using three primary methods—remove for value-based removal, pop for index-based removal that returns the element, and del for deleting by index, range, or entire objects—complete with clear code examples and key usage notes.

ListPythonTutorial
0 likes · 4 min read
Master Python List Deletion: remove, pop, and del Explained
Programmer DD
Programmer DD
Oct 27, 2021 · Backend Development

Why Removing Elements from a Java List Often Fails and How to Fix It

This article explains common pitfalls when deleting elements from a Java List—such as index shifting, ConcurrentModificationException in foreach loops, and the difference between removing by index versus by object—and provides reliable solutions using index adjustment, reverse iteration, and Iterator.remove().

ConcurrentModificationExceptionIteratorJava
0 likes · 8 min read
Why Removing Elements from a Java List Often Fails and How to Fix It
Java Backend Technology
Java Backend Technology
Oct 9, 2021 · Fundamentals

Avoid Common Pitfalls When Removing Elements from Java Lists

This article explains why naïve removal of elements from a Java List can produce unexpected results or throw ConcurrentModificationException, and demonstrates seven safe techniques—including index adjustment, reverse iteration, and iterator‑based removal—along with code samples and detailed reasoning.

CollectionsIteratorJava
0 likes · 8 min read
Avoid Common Pitfalls When Removing Elements from Java Lists
Selected Java Interview Questions
Selected Java Interview Questions
Apr 27, 2020 · Fundamentals

How to Remove Elements from a List Without Causing java.util.ConcurrentModificationException

This article explains why removing items from a Java List inside a foreach loop triggers a ConcurrentModificationException and demonstrates three correct approaches—using Iterator.remove(), a forward indexed for loop with index correction, and a reverse for loop—each with full code examples and output.

ArrayListConcurrentModificationExceptionIterator
0 likes · 6 min read
How to Remove Elements from a List Without Causing java.util.ConcurrentModificationException