Kotlin Vs Java

Kotlin Vs Java

Kotlin Vs Java

Some Java issues addressed in Kotlin

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

What Java has that Kotlin does not

  • Checked exceptions that are not classes
  • Static members
  • Wildcard-types

What Kotlin has that Java does not

  • Lambda expressions + Inline functions
  • Null-safety
  • String templates
  • Primary constructors
  • Type inference for variable and property types
  • Declaration-site variance & Type projections
  • Operator overloading
  • Companion objects
  • Separate interfaces for read-only and mutable collections

No comments:

Post a Comment

Kotlin FAQ