Kotlin features
Kotlin was designed not to compete with Java, but rather to be a good JVM language with added features not present in Java. Kotlin, as a language, has lots of new and exciting features, compared to Java, that increase code readability and maintainability.
It is vital to understand the basic features of Kotlin. In this section, we will explore a few of them that are essential for building an application in Kotlin.
The concept of a function
By definition, a function is a set or group of related statements that perform a specific task. It is a basic building block of any program. You can equate the function in Kotlin with the method in Java; however, there are certain differences. The function in Kotlin can be defined at the top level, meaning it is not required to be enclosed in a class. The function can be part of a class as well as defined within another function.
In Kotlin, the functions get first-class support, meaning it supports all the operations and can be stored into a...