Kotlin Basics of Kotlin


This topic covers the basics of Kotlin for beginners.


  1. Kotlin file has an extension .kt.
  2. All classes in Kotlin have a common superclass Any, that is a default super for a class with no supertypes declared(similar to Object in Java).
  3. Variables can be declared as val(immutable- assign once) or var(mutables- value can be changed)
  4. Semicolon is not needed at end of statement.
  5. If a function does not return any useful value, its return type is Unit.It is also optional. 6.Referential equality is checked by the === operation. a === b evaluates to true if and only if a and b point to the same object.