Kotlin Vs Java

Amansingh Javatpoint
2 min readJul 28, 2021

--

There are many languages available for Android development. Java is the official language for android development but Kotlin is becoming popular nowadays. This article discusses both of these languages and the differences between them.

What is Kotlin?

  • Kotlin is a general-purpose, open source programming language.
  • Kotlin was originally developed by JetBrains, the same company that developed IntelliJ IDEA in the year 2010.
  • Kotlin version 1.0 was officially released in February 2016.
  • Kotlin is now supported by JetBrains and Google via the Kotlin Foundation.
  • Kotlin programs are executed on Java Virtual Machine (JVM). They can be executed on various other platforms.
  • Kotlin follows Object Oriented as well as the Functional Programming approach.

Kotlin program Example

The following program demonstrates how to write a basic Java program.

Sample.kt

fun main()

{

println(“Hello World”)

}

Output:

Hello World

In the above Kotlin code,the main() function has a printlin()function that displays the output on the console window.

Features of Kotlin

  • Kotlin offers faster compilation.
  • Kotlin provides many extension functions without changing any code.
  • Smart cast feature helps to reduce the cost of application and improves the speed as well as the performance of the application.

What is Java?

  • Java is an Object-Oriented Programming language. It was developed and releasedby Sun Microsystems in the year 1995.
  • Java programming is one of the most preferred programming languages because of security. It is platform-independent. It does not support explicit pointers. It makes Java programs more secure.
  • One must install JDK before executing the Java program. The Java code is first compiled into a byte code. And the byte code is then interpreted. The byte code can be executed on any other platform which has Java Virtual Machine (JVM) installed on it. This makes the Java programs portable.
  • There are three versions of Java.
  • Java EE (Enterprise Edition)
  • Java SE (Standard Edition)
  • Java ME (Micro Edition)

--

--

No responses yet