0
0
Kotlinprogramming~5 mins

Kotlin REPL and script mode - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Kotlin REPL?
Kotlin REPL is a Read-Eval-Print Loop. It lets you write and run Kotlin code line by line in an interactive way, like chatting with the computer.
Click to reveal answer
beginner
How do you start Kotlin REPL from the command line?
You type kotlinc and press Enter. This opens the Kotlin REPL where you can type Kotlin code directly.
Click to reveal answer
beginner
What is Kotlin script mode used for?
Kotlin script mode lets you write Kotlin code in a file with .kts extension and run it without compiling. It's good for quick tasks and automation.
Click to reveal answer
beginner
How do you run a Kotlin script file named hello.kts?
You run kotlin hello.kts in the command line. This executes the script without creating a separate program.
Click to reveal answer
intermediate
What is the main difference between Kotlin REPL and script mode?
REPL runs code interactively line by line, great for testing ideas quickly. Script mode runs a whole Kotlin file as a script, useful for small programs or automation.
Click to reveal answer
What does REPL stand for in Kotlin?
ARun-Evaluate-Process Loop
BRun-Execute-Program Language
CRead-Eval-Print Loop
DRead-Edit-Print Language
Which command starts the Kotlin REPL?
Akotlinc
Bkotlin run
Ckotlin script
Dkotlinc -script
What file extension is used for Kotlin script files?
A.kt
B.kotlin
C.script
D.kts
How do you run a Kotlin script file named test.kts?
Akotlin test.kts
Bkotlinc -script test.kts
Ckotlinc test.kts
Dkotlin -script test.kts
Which mode is best for quickly testing small pieces of Kotlin code?
AScript mode
BREPL
CCompiled mode
DDebug mode
Explain how Kotlin REPL helps beginners learn Kotlin.
Think about how typing code line by line and seeing results helps learning.
You got /3 concepts.
    Describe the steps to run a Kotlin script file from the command line.
    Focus on the file type and the command used.
    You got /3 concepts.