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
  • == vs === and the “value vs reference” model

    Kotlin SELF
    23 level,0 lecture
    We break down two kinds of equality in Kotlin: structural comparison via == (by value, via equals, and safe for null) and referential comparison via === (object identity). We discuss aliasing with collections, why val does not make an object immutable, the === trap with nullable numbers ( Int?), and practical techniques like copying a list via toList() to create a data “snapshot”.
    Open
  • Basic list sorting — sorted() / sortedDescending()

    Kotlin SELF
    23 level,1 lecture
    We break down basic list sorting in Kotlin without mutations: how sorted() and sortedDescending() work, what “natural order” means and what Comparable has to do with it, why it’s important not to break the original data, and how to apply sorting in the mini project ExpensePocket. At the end — a review of typical mistakes (lost result, confusing “sorting vs reversing”, unnecessary sorting just to get max/min).
    Open
  • Sorting by key and multiple criteria in Kotlin

    Kotlin SELF
    23 level,2 lecture
    We cover sorting collections in Kotlin “by key” using sortedBy and sortedByDescending, build the top‑N pattern as sortedByDescending(...) + take( n), and also learn how to sort by multiple criteria using sortedWith and compareBy. Along the way, we reinforce the difference between an “element” and a “sort key” and typical mistakes (for example, using take without sorting).
    Open
  • Nullable in sorting: defaults, splitting, and a clear rule for null

    Kotlin SELF
    23 level,3 lecture
    Let’s break down how to sort collections in Kotlin when the key can be null: why sorting needs an explicit contract (“ null first/last”), how to use the Elvis operator ?: with safe defaults ( sortedBy, sortedByDescending), why “magic numbers” like Int . MAX_VALUE can be dangerous, and when it’s better to split the data ( filterNotNull(), counting null, split+merge). Everything is shown using an expenses report example in a hypothetical BudgetBuddy app.
    Open
  • Comparing arrays: why == doesn’t work and when you need contentDeepEquals

    Kotlin SELF
    23 level,4 lecture
    Let’s break down why arrays in Kotlin/JVM are not compared element-by-element via ==, how == and === differ, and which functions to use for correct data comparison: contentEquals() for flat arrays and contentDeepEquals() for nested arrays. We’ll also discuss the aliasing trap (“before/after” without a copy) and practical ways to diagnose issues with joinToString() and contentDeepToString().
    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