Skip to content

L9: Classes, Inheritance, and Visibility

In this lesson we will explore:

  • Deep Theory: Classes, primary and secondary constructors with init blocks, visibility modifiers (public, internal, protected, private), open vs final classes (closed by default), interfaces, and composition over inheritance.
  • Under the Hood: How Kotlin compiles classes as final by default in Bytecode and automatically generates getters/setters for properties.
  • Incremental Lab (AI Chat CLI): Encapsulating the core engine (ChatEngine) and abstracting internal chat services behind cohesive interfaces.