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
  • data class as a data model

    Kotlin SELF
    33 level,0 lecture
    We break down why Kotlin needs data class and how it removes routine work in models: what exactly the compiler generates ( toString(), equals()/ hashCode(), copy(), componentN()), what rules apply to the primary constructor ( val/ var), and how to use this in practice with an expense model example. At the end — common mistakes and how to avoid them.
    Open
  • Equality, hashCode, and toString in a data class

    Kotlin SELF
    33 level,1 lecture
    We break down how Kotlin generates equals(), hashCode(), and toString() in a data class; how == differs from ===; which properties participate in comparison (only those from the primary constructor); and why without a stable hash the logic of Set/ Map breaks. Plus: practical examples using the Expense model and common pitfalls with mutable keys.
    Open
  • copy() and model immutability — updating without mutation and shallow copy

    Kotlin SELF
    33 level,2 lecture
    Let’s break down how to update data in Kotlin without mutation: why immutable models based on val make debugging easier, how copy() works for data class, how to update an element in a MutableList by “replacing the object” or build a new list via map, and where the main trap is hiding — shallow copy with shared nested references (for example, a MutableList). At the end: practical functions for an expense tracker and common mistakes.
    Open
  • Destructuring data class: componentN() and readability criteria

    Kotlin SELF
    33 level,3 lecture
    We break down how destructuring works in Kotlin: why an expression like val ( title, category, amount) = e actually expands into a chain of calls component1()/ component2()/ component3(), what exactly the compiler generates for a data class, where it’s convenient to use _, and why the order of properties in the primary constructor directly affects the meaning of the code. At the end: readability criteria and typical mistakes that “quietly” surface during refactoring.
    Open
  • typealias and value class: readability and type safety

    Kotlin SELF
    33 level,4 lecture
    We break down two Kotlin tools for “semantic types”: typealias (improves readability, but does not create a new type) and value class (creates a distinct type on top of a single value and gives compiler-level protection). Using a console “Expense Tracker” as an example, we strengthen the model with domain types ( ExpenseId, Money), discuss inline value class limitations, validation via require(...), comparison of == vs ===, and typical selection mistakes.
    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