What is the Java equivalent Scannerin Kotlin?
Scanner
I used readLine(), but I would like to know if it is type safe or not?
readLine()
You can try something like this
val scan = Scanner(System.`in`) val n = scan.nextLine().trim().toInt()
Since "in" is the Kotlin keyword
Kotlin reuses many existing Java libraries, and this is great for Scanner. Otherwise, it readLinesimply uses System.in, as you can see here , which may be a simple alternative for you.
readLine
System.in
Source: https://habr.com/ru/post/1694169/More articles:Capturing Terminal Terminals / Outputs Using Symfony Console (CTRL + C) - phpHow do I know the time difference, even if you pass midnight? python - pythonWhat is the type of lambda functions? C ++ - c ++Python timedelta format over 24 hours to display with clock only? - pythonWhy does scala `GenTraversableOnce` not declare a` map`? - scalaJSON Unmarshal struct case-sensitively - jsoninvalid reference image Arkyt 1.5 - image-processingHow to get maximum value based on another series in pandas groupby - pythonImplementing real "forall" in scala futures list - scalafragment recyclerview different views do not work - javaAll Articles