• Java was released by Sun Microsystems in 1995.
  • Kotlin was released by JetBrains in 2016

Kotlin is fully interoperable with Java

This means you can gradually adopt Kotlin in existing Java projects or use Java libraries in Kotlin projects.


Reasons for Kotlin’s Introduction

  1. Conciseness and Readability: Kotlin aims to reduce boilerplate code, making code more concise and readable compared to Java
  2. Null Safety: Kotlin introduces null safety features, helping to prevent null pointer exceptions, which are common in Java
  3. Modern Language Features: Kotlin includes features like type interfaces, extension functions, data classes, smart casts, and more, which provide developers with more expressive and modern language constructs

Functional Programming

Java did not support functional programming until Java 8 and Kotlin was built from the ground up with support for functional programming


Conciseness of Kotlin

// java
 
public class MyClass {
   private int myField;
 
   public MyClass(int myField) {
      this.myField = myField;
   }
 
   public int getMyField() {
      return myField;
   }
 
   public void setMyField(int myField) {
      this.myField = myField;
   }
}
// kotlin
 
class MyClass(private var myField: Int) {
   fun getMyField() = myField
   fun setMyField(value: Int) { myField = value }
}

Ref