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
  • forEach and side effects: when it makes sense

    Kotlin SELF
    22 level,0 lecture
    We break down how forEach differs from the for loop in Kotlin: why forEach is a function, why it returns Unit, where side effects (printing, logging, function calls) are appropriate, and where it’s better to choose collection transformations. We also look at handy patterns like ?. forEach for nullable collections, the callable reference :: println, and typical mistakes: expecting a “result,” accumulating hidden state, and trying to use break/ continue.
    Open
  • map and filter — transformation and selection as a baseline style

    Kotlin SELF
    22 level,1 lecture
    We break down the basic “pipeline” style of working with collections in Kotlin: how map() turns each element into a new value, how filter() keeps only the elements that match, why these operations create a new result (and do not mutate the source collection), how to read step-by-step chains and choose the right order of transformations. At the end — a practical CLI example and an analysis of typical mistakes (side effects, wrong lambda return type, overly long lambdas).
    Open
  • find/any/all/count: searching, checks, and counting without manual loops

    Kotlin SELF
    22 level,2 lecture
    We break down Kotlin’s standard collection operations — find, any, all, count: how to find the first matching element and work with a nullable result ( T ?), how the “at least one” and “all” checks differ, why all on an empty list returns true, and how to write remove/ stats commands in a CLI without manual loops, flags, and extra counters.
    Open
  • mapNotNull and filterNotNull: data cleanup and type changes

    Kotlin SELF
    22 level,3 lecture
    We break down how to remove null from collections in Kotlin and “fix” types at the same time: how mapNotNull differs from the map + filterNotNull combo, why toIntOrNull() pairs perfectly with mapNotNull, how to get List<Int> instead of List<Int?>, and how to build robust processing pipelines for “dirty” input without extra checks.
    Open
  • Readable chains of operations — results without mutating the original collection

    Kotlin SELF
    22 level,4 lecture
    We break down how to build data-processing “pipelines” over collections in Kotlin without mutating the original list: combine map/ filter/ mapNotNull, finish chains via find/ any/ all/ count, separate computation from printing (leaving forEach for the very end), and learn to “break” long chains with intermediate vals for readability. In the examples: a mini project for expenses based on Triple, input normalization, and safe work with null.
    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