Member-only story
Usages
Questions
Q1. What is Kotlin?
Kotlin is the latest general-purpose programming language from JetBrains with the type interference. It is totally interpolated with the JVM and also combines javascript or code. Google officially promoted kotlin on Android for mobile development. Kotlin is considered as a substitute to the standard java compiler.
Q2. What’s a const? How does it differ from a val?
By default val properties are set at runtime. Adding a const modifier on a val would make a compile-time constant.
- A const cannot be used with a var or on its own.
- A const is not applicable on a local variable.
Q3. Does Kotlin allow us to use primitive types such as int, float, double?
Answer: No kotlin does not support primitive datatypes as like in java. At the language level, we cannot use the above-mentioned types. But the JVM bytecode that’s compiled does certainly have them.