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
  • Interface as a contract — methods, properties, and default implementations

    Kotlin SELF
    37 level,0 lecture
    We break down an interface in Kotlin as a contract: what exactly a class “promises” when it writes : SomeInterface, how fun methods work without a body and with a default implementation, why val/ var properties in an interface are not “storage fields”, and how to write reusable functions that accept an interface type (for example, CliPrintable) instead of concrete classes. Inside: practical examples with Identifiable, Greeter, RenderableLine, and HasTitle, plus a walkthrough of typical mistakes.
    Open
  • Multiple interface implementation

    Kotlin SELF
    37 level,1 lecture
    We break down multiple interface implementation in Kotlin: why it’s better to keep interfaces narrow, how Kotlin forbids ambiguity when implementations conflict, when override is mandatory, and how to explicitly choose the needed implementation via super<...>. Using examples, we’ll show conflicts of default methods, a combination of default + abstract declaration, conflicts between a base class and an interface, as well as similar situations with properties ( val).
    Open
  • fun interface and SAM conversion

    Kotlin SELF
    37 level,2 lecture
    We break down why Kotlin needs fun interface, what SAM conversion is, and how the compiler “turns” a lambda into an interface object. We will compare a SAM interface with function types ( ( Int ) -> Boolean) and typealias, build a registry of CLI commands via CommandHandler, discuss closures and common mistakes (two abstract functions, signature mismatch, hidden mutability).
    Open
  • sealed interface — a closed set of variants

    Kotlin SELF
    37 level,3 lecture
    We break down how sealed interface helps model a “closed set of variants” instead of strings, flags, and null. We learn to parse input into the Command type, write an exhaustive when without else, introduce an execution result via CommandResult ( Ok/ Error), and also look at the nuances of choosing between enum, sealed class, and sealed interface.
    Open
  • object, companion object, object : ... — singleton and one-off objects

    Kotlin SELF
    37 level,4 lecture
    We will cover three forms of objects in Kotlin: a named singleton via object, an “almost static” API via companion object, and one-off implementations via object : Interface { ... }. Along the way, we will discuss where to store constants and factories, how not to turn a singleton into a “global junk drawer,” and why an anonymous object may “lose” its unique methods because of the variable’s static type.
    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