Kotlin Programming

  1. Object-Oriented Programming in Kotlin
    1. Classes and Objects
      1. Defining a Class
        1. Creating Instances (Objects)
          1. Class Members
            1. Properties
              1. Declaring Properties
                1. Getters and Setters
                  1. Custom Accessors
                    1. Backing Fields
                      1. Late-Initialized Properties (`lateinit`)
                        1. Lazy Properties (`by lazy`)
                        2. Methods (Member Functions)
                          1. Class Body
                          2. Constructors
                            1. Primary Constructor
                              1. Property Initialization
                                1. Default Values
                                  1. Visibility Modifiers
                                  2. Secondary Constructors
                                    1. The `init` Block
                                      1. Constructor Delegation
                                      2. Inheritance
                                        1. The `open` Keyword
                                          1. Extending Classes
                                            1. Overriding Methods and Properties
                                              1. The `super` Keyword
                                                1. Calling Superclass Implementation
                                                  1. Final Classes and Methods
                                                    1. Any Class (Root of Hierarchy)
                                                    2. Abstract Classes and Methods
                                                      1. Declaring Abstract Classes
                                                        1. Abstract Properties
                                                          1. Implementing Abstract Members
                                                            1. Abstract vs. Open
                                                            2. Interfaces
                                                              1. Defining Interfaces
                                                                1. Implementing Interfaces
                                                                  1. Properties in Interfaces
                                                                    1. Default Implementations
                                                                      1. Resolving Overriding Conflicts
                                                                        1. Functional Interfaces (SAM)
                                                                        2. Visibility Modifiers
                                                                          1. `public`
                                                                            1. `private`
                                                                              1. `protected`
                                                                                1. `internal`
                                                                                  1. Visibility in Packages and Modules
                                                                                    1. Constructor Visibility
                                                                                    2. Special Class Types
                                                                                      1. Data Classes
                                                                                        1. Declaration and Use Cases
                                                                                          1. Requirements and Restrictions
                                                                                            1. Auto-Generated Functions
                                                                                              1. `equals`
                                                                                                1. `hashCode`
                                                                                                  1. `toString`
                                                                                                    1. `copy`
                                                                                                      1. `componentN`
                                                                                                      2. Destructuring Declarations
                                                                                                      3. Sealed Classes
                                                                                                        1. Use Cases
                                                                                                          1. Sealed Class Hierarchies
                                                                                                            1. Sealed Interfaces
                                                                                                              1. When Expressions with Sealed Classes
                                                                                                              2. Enum Classes
                                                                                                                1. Defining Enums
                                                                                                                  1. Enum Properties and Methods
                                                                                                                    1. Enum Constants
                                                                                                                      1. Anonymous Classes in Enums
                                                                                                                      2. Nested and Inner Classes
                                                                                                                        1. Static Nested Classes
                                                                                                                          1. Inner Classes (Access to Outer Class)
                                                                                                                            1. Anonymous Inner Classes
                                                                                                                          2. Objects and Companions
                                                                                                                            1. Object Expressions (Anonymous Objects)
                                                                                                                              1. Object Declarations (Singletons)
                                                                                                                                1. Companion Objects
                                                                                                                                  1. Static Members
                                                                                                                                    1. Factory Methods
                                                                                                                                      1. Companion Object Extensions
                                                                                                                                        1. Accessing Companion Objects