- Create a new project as specified in the previous post.
- Right-click on src folder and select New->Kotlin File/Class.
- In the dialog box, specify the name of the file and click on OK.
- Type the following code:
fun main(args: Array<String>)
{
println(“hello, Kotlin!”)
}
- From the top menu bar, click on the Run->Run… . A list of configurations will appear. Note that the IDE has already created a configuration for us.
- Choose the HelloKt (which is the name of the Kotlin file).
- The output should appear in the bottom pane.
- Note that the project structure will show an Out directory containing the generated class file.