To write Kotlin program, we can use any text editor like: Notepad,Notepad++ , sublime .

Save the file with name First.kt , .kt extension is used for Kotlin file.

  • How to Compile Kotlin File

    Open command prompt and go to directory location where file is stored. and type follwing command.

    How to Compile Kotlin File
    Example)
    drag_handle
     
    fun main(args:Array<String>)
    {
    println("This is our first kotlin program");
    
    }
    Output:
    This is our first kotlin program
  • How to Run Kotlin Program

    To run the Kotlin .jar (First.jar) file run the following command.

    java -jar First.jar

    How to Run Kotlin Program

What next?

Share this page