Comparison to Java
Kotlin fixes a series of issues that Java suffers from:
Null references are controlled by the type system.
Arrays in Kotlin are invariant
Kotlin has proper function types, as opposed to Java's SAM-conversions
Use-site variance without wildcards
Kotlin does not have checked exceptions
Primitive types that are not classes. The byte-code uses primitives where possible, but they are not explicitly available.
Static members are replaced with companion objects, top-level functions, extension functions, or @JvmStatic.
Wildcard-types are replaced with declaration-site variance and type projections.
Ternary-operator
a ? b : c
is replaced with if expression.package-private visibility modifier
Lambda expressions + Inline functions = performant custom control structures
Smart casts (Java 16: Pattern Matching for instanceof)
String templates (Java 21: String Templates (Preview))
Type inference for variable and property types (Java 10: Local-Variable Type Inference)
Learn how to: