October 2019
Intermediate to advanced
434 pages
11h 54m
English
Java developers are used to writing object-oriented code. In Java, everything must happen within a class, so it likely comes as no surprise that Kotlin fully supports Object-Oriented Programming. In fact, Kotlin improves upon Java's support and provides convenient solutions for common Object-Oriented Programming patterns such as defining singletons, creating immutable data classes, and providing getters/setters.
The following code snippet shows a basic example of programming in Kotlin using object-oriented principles. It demonstrates the implementation of a simple class along with accessing the public property of that class:
data class Language(val name: String)fun main(args: Array<String>) { val language = Language("Kotlin") ...
Read now
Unlock full access