Kotlin Programming

Kotlin is a programming language that is used, for example, in Android programming.

The table contains links to simple Kotlin programs that can be executed, for example, on command line.

The following links should be helpful when you study the basics of Kotlin.



How to execute the above programs?

To run and execute the above programs you need to install the Kotlin compiler. From this page you will find instructions for downloading the compiler.

The above programs can be downloaded by Right-clicking the links, the file names. For example, if I download the file Game.kt and put it into a folder named C:\kotlinwork, I can compile the program by giving the following commands in the Command Prompt Window on a Windows computer

cd kotlinwork
c:\freeware\kotlinc\bin\kotlinc Game.kt -include-runtime -d Game.jar

In this example, it is necessary to type a long path name in order to invoke the compiler.

After the Kotlin porgram is compiled with the above command, it can be executed with a command like

java -jar Game.jar

Here it is supposed that the Java runtime command is in the Path environment variable, so that it is not necessary to type a long command name.

Running programs in the Command Prompt Window is not so difficult when you remember that commands can be repeated with the Arrow-Up and Arrow-Down keys. All the above programs have been developed so that I have written them with the free Notepad++ editor and then executed them with commands such as the one above.