Basics of Kotlin
This topic covers the basics of Kotlin for beginners.
- Kotlin file has an extension .kt.
- 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).
- Variables can be declared as val(immutable- assign once) or var(mutables- value can be changed)
- Semicolon is not needed at end of statement.
- 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.
Table Of Contents