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

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Iterable and Iterator: what’s behind for ( x in collection)

    Kotlin SELF
    20 level,0 lecture
    Let’s break down how the for loop works in Kotlin “under the hood”: why it relies on the Iterable<T> contract, how Iterator<T> is created and used, what the methods iterator(), hasNext(), and next() do, and which mistakes most often happen when manually iterating collections. At the end, there’s a mini practice task: printing tasks in SimplePlanner.
    Open
  • Iterating a List: indices, lastIndex, withIndex() and choosing a style

    Kotlin SELF
    20 level,1 lecture
    We break down List iteration styles in Kotlin: when a for loop over values is enough, what the difference is between size and lastIndex, how to safely iterate by indices via indices, and how to print “number + value” using withIndex(). We’ll also discuss boundaries, empty lists, a mini example for a Task CLI, and common mistakes that lead to IndexOutOfBoundsException.
    Open
  • Iterating over a Map: keys, values, entries, Map.Entry, and destructuring (k, v)

    Kotlin SELF
    20 level,2 lecture
    We’ll break down why Map cannot be iterated “by indexes”, how to work with the views keys/ values/ entries, what Map.Entry is and how it differs from Pair. We’ll learn how to choose an iteration style (keys, values, or pairs), use destructuring ( k , v ) in a loop, and also reinforce everything with a practical example of an expense-category report and analyze common mistakes.
    Open
  • Safe removal while iterating collections

    Kotlin SELF
    20 level,3 lecture
    We break down why removing elements “on the fly” often leads to ConcurrentModificationException or silent logic bugs, and learn how to choose the right strategy in Kotlin/JVM: removal via MutableIterator. remove(), iterating a list by indices from right to left with removeAt, as well as safely cleaning a MutableMap via an iterator over entries.
    Open
  • Practical example: parsing input and updating collections

    Kotlin SELF
    20 level,4 lecture
    We break down how to organize a “command menu” in a Kotlin console application: normalize a line with trim(), parse the command and argument into a Pair, route actions via when, and safely update a MutableList<String>. We also compare removeAt(index) and remove(value), show correct multiple deletion via an iterator, and highlight common mistakes (index vs number, bounds checks, deleting inside for).
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush