CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Extension functions: syntax, receiver, visibility

    Kotlin SELF
    Level 38, Lesson 0
    We break down extension functions in Kotlin: how the syntax fun Type . method () works, what a receiver is and what this means inside an extension, what limitations visibility ( private/ protected) imposes, why a member method wins on conflicts, and why extensions are resolved statically (this is not override). We illustrate all ideas with a mini CLI example for expense tracking.
    Available
  • Extension properties

    Kotlin SELF
    Level 38, Lesson 1
    We break down extension properties in Kotlin: why this is not “adding a field”, how get()/ set() work, where computed properties are appropriate (input normalization, money formatting, output strings), why “heavy” getters and side effects are dangerous, and also how (and why cautiously) to make a var via external storage like MutableMap.
    Available
  • operator in Kotlin: plus, compareTo, plusAssign

    Kotlin SELF
    Level 38, Lesson 2
    We break down Kotlin operator conventions: how expressions like a + b are translated by the compiler into a call to a . plus ( b ), how += works (via plusAssign or via reassignment), and why comparisons </ > are based on compareTo. Using the Money type as an example, we discuss surprise-free design, readability, and common mistakes.
    Available
  • Indexing operators get/set: obj[i], obj[i, j]

    Kotlin SELF
    Level 38, Lesson 3
    We break down how, in Kotlin, the square-bracket syntax is turned by the compiler into calls to get/ set, and why the operator modifier is needed. We look at indexers in the standard library ( List, MutableList, Map, MutableMap), design our own indexers using the training app BudgetBuddy as an example, discuss contracts (fail-fast vs nullable), and the multi-index variant obj[i, j].
    Available
  • Mini API on top of extensions and operators

    Kotlin SELF
    Level 38, Lesson 4
    We break down how, in Kotlin, to design a small “convenience layer” on top of a domain using extension functions and extension properties, operators ( += / +), and targeted infix calls. Using expense tracking as an example, we build a mini model ( Expense, Money), a report accumulator ( Report), and a readable scenario in main. We also discuss the criteria “cheap,” “no surprises,” and “the name makes the meaning obvious,” plus common mistakes when overloading “conveniences.”
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym