I am trying to get familiar with Kotlin to use in my android apps. So first I want to try out some simple kotlin examples, just to get familiar with syntax of kotlin.
<
Update:
Approach 1:
Now you can create a kotlin file with empty main() method and then you can run the code directly using run icon on left(of 7th line) in android studio (AS version: 3.5.3 ) editor like
This will internally create the TestKt(name of file) class with PSVM method(and required structure) to execute the code.
Demo configuration(automatically generated) to run this file will look like
Approach 2(with Scratch file, tested on AS 3.6):
Project view in the project navigation panel.New -> Scratch File -> Kotlin
Android studio (intellij) provides REPL(Real Eval Print Loop) tool to write and execute kotlin code.
Tool -> kotlin -> kotlin REPLEither write code or import the class
Tips: