Skip to content

Commit

Permalink
fix: one less step
Browse files Browse the repository at this point in the history
  • Loading branch information
zamulla committed Nov 14, 2024
1 parent 7429e28 commit cf3ef90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/topics/jvm/jvm-get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ To get started, first download and install the latest version of [IntelliJ IDEA]
![Main.kt with main fun](jvm-main-kt-initial.png){width=700}
2. Modify the code so that it requests your name and says `Hello` to you:
* Change the local variable name from `val` to `var` so that you can change its value dynamically.
* Create an input prompt and assign to the `name` variable the value returned by the [`readln()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/readln.html) function.
* Let's use a string template instead of concatenation by adding a dollar sign `$` before the variable name directly in the text output like this – `$name`.
```kotlin
fun main() {
var name = "Kotlin"
println("What's your name?")
name = readln()
val name = readln()
println("Hello, $name!")
// ...
}
```
Expand Down

0 comments on commit cf3ef90

Please sign in to comment.