Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Learn & Inspire Series - Kotlin

Android Learn & Inspire Series - Kotlin

Unit 2 Pathway 1:
Kotlin Fundamentals

Avatar for Eldho P James

Eldho P James

November 08, 2022

Other Decks in Technology

Transcript

  1. Android Learn & Inspire Series Unit 2 Pathway 1: Kotlin

    Fundamentals By: Eldho P James https://www.linkedin.com/in/eldhopj/
  2. Constructor In Kotlin, there are two constructors: • Primary constructor

    - concise way to initialize a class • Secondary constructor - allows you to put additional initialization logic • Init block
  3. Inheritance All classes and functions in kotlin are by default

    final Open Keyword to make it non final If we want to override we have to use override keyword We can use super keyword to access the parent class properties
  4. Delegation • The Delegation pattern • Efficient way of writing

    Inheritance • Kotlin supports it natively requiring zero boilerplate code • Its a design pattern by introducing a keyword “by”. • Advantage of using delegation is single responsibility principle