0

When I taking String input using readLine() method in kotlin using an online compiler officially provided by Jetbrains it gives me an exception today. Here is screenshot?

Output of Kotlin Compiler

I also tried taking input using scanner class but it also does not works.

I am a beginner and practice kotlin basics using this compiler but its works fine till yesterday but i wonder why it not works today? Is there some error in my code or compiler bug?

Programmer_3
  • 522
  • 5
  • 18
  • 1
    This usually means that there is no console connected, so readLine() has no input to read from. – Mark Rotteveel Jul 31 '21 at 10:35
  • What can we do now to rid from that problem? @MarkRotteveel – Programmer_3 Jul 31 '21 at 10:38
  • 1
    My guess is that the online compiler doesn't support input, so you simply cannot do it like this. Install Kotlin locally and use that instead. – Mark Rotteveel Jul 31 '21 at 10:40
  • 1
    Kotlin playground doesn't provide a console input. If you want to try out things like that, I'd suggest using a Kotlin scratch file on Intellij IDEA IDE. Example provided in this old [answer](https://stackoverflow.com/questions/59754382/kotlin-scratch-file-android-studio-readline/62015494#62015494) of mine. – Madhu Bhat Jul 31 '21 at 11:03

0 Answers0