Kotlin classes with examples

While retaining the same basic principles of object oriented programming in Java, Kotlin has introduced some smart techniques which are nice enhancements /or extensions to the Java’s object oriented paradigm.

Here is a quick summary of Kotlin’s classes :

    class Computer(var cpuType : String, var ramSize : Int)

    var computer  = Computer(cpuType = "apple silicon", ramSize = 16)
    computer.cpuType = "i9"
    computer.ramSize = 64
    data class Computer(var cpuType : String, var ramSize : Int)