You've been tasked with creating a basic program in Kotlin that asks the user to input a number, and then displays the number that was entered. The catch is that your input reader should utilize Java's Scanner class. You have started to write a basic skeleton for your program but there are some incomplete parts. Your task is to fill in the blanks in the code to make it function as described.
Standard input with Java Scanner
Create a program using Java's Scanner class for user input
Report a typo
Fill in the gaps with the relevant elements
import java.util.
fun main(args: Array<String>) {
val scanner = Scanner(System.`in`)
("Please enter a number:")
val number = scanner.()
println("You entered: $number")
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.