JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Filtering collection elements

    JAVA 25 SELF
    28 level,0 lecture
    In this lecture, we explore practical collection filtering in Java: an imperative approach using a for loop, safe removal during iteration with an Iterator and its remove() method, as well as the modern and concise removeIf (Java 8+). We will discuss why ConcurrentModificationException occurs, when it makes sense to create a new list, and the typical mistakes most often made when formulating filtering conditions.
    Open
  • Collection transformation

    JAVA 25 SELF
    28 level,1 lecture
    In this lecture, we examine how to perform collection transformation imperatively: turning List<String> into List<Integer> (for example, string lengths), how to extract fields from domain model objects ( Product → name/price), how to “flatten” nested collections via addAll() or nested loops, and how to combine filtering with transformation using if and methods like startsWith. We will finish by reviewing common mistakes: mutating the source collection, incorrect casts ( ClassCastException), and performance considerations.
    Open
  • Safe removal of elements

    JAVA 25 SELF
    28 level,2 lecture
    In practice, removing elements from collections often leads to a ConcurrentModificationException. In this lecture we’ll break down why this happens when iterating with for-each, how to safely remove elements using Iterator.remove(), why ListIterator is useful, when to choose removeIf (Java 8+), and how to work correctly with a Map. At the end — practical tips and common pitfalls.
    Open
  • EnumSet/EnumMap

    JAVA 25 SELF
    28 level,3 lecture
    In this lecture we break down specialised collections for enums — EnumSet and EnumMap from java.util: how they work under the hood (bitmasks and indexing by ordinal), why they are faster and more compact than HashSet/ HashMap, where to apply them (flags, lookup tables, finite state machines), what pitfalls come with changing an enum and with serialization, plus a set of best practices and common mistakes with clear code examples.
    Open
  • LinkedHashSet/LinkedHashMap

    JAVA 25 SELF
    28 level,4 lecture
    In this lecture we cover order‑preserving collections: LinkedHashSet and LinkedHashMap. You will learn how they maintain insertion order and access order, how to build an LRU cache in a few lines by overriding removeEldestEntry, what the memory and performance overheads are compared to HashSet/ HashMap, when a deterministic order is needed for stable tests and reports, and why ArrayDeque is better than LinkedList for queues/stacks. At the end — common pitfalls and how to avoid them.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy