Miguel Quinta
09/10/2020, 11:39 AMMilan Hruban
09/10/2020, 12:03 PMInt?
. By using nextLine
, feeding newline will cause the scanner to stop reading
val scanner = Scanner(System.`in`)
val myNum = scanner.nextLine().toIntOrNull()
Miguel Quinta
09/10/2020, 12:12 PMMiguel Quinta
09/10/2020, 12:12 PM