【发布时间】:2020-12-13 22:05:18
【问题描述】:
我编写了一个简单的程序,它从控制台获取用户的输入,然后将其打印出来。但是当用户输入输入时,它会请求第二个用户输入并且只读取第二个输入。
代码:
fun main(args: Array<String>) {
print("Enter text: ")
val stringInput = readLine()!!
println("Readed text: $stringInput")
}
控制台:
> Task :MainKt.main()
Enter text: FirstInput
SecondInput
Disconnected from the target VM, address: 'localhost:37282', transport: 'socket'
Connected to the target VM, address: '127.0.0.1:37264', transport: 'socket'
Readed text: SecondInput
我正在使用最新版本的 IntelliJ IDEA。我不知道为什么会这样。我正在使用 Windows。
【问题讨论】:
标签: kotlin intellij-idea