如果我导入readline,我会收到错误,如下所示:
import scala.io.StdIn.{readline, readInt}
=>
error: value readline is not a member of object scala.io.StdIn
import scala.io.StdIn.{readline, readInt}
如果我不导入此内容,我会收到一条弃用的消息:
warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
one warning found
如果我使用函数的填充路径,我没有错误:
var x = scala.io.StdIn.readLine.toInt
如果您能帮我解决导入问题,请告诉我。感谢。
答案 0 :(得分:3)
非常小的忽视:
import scala.io.StdIn.{readLine, readInt}
readLine
有一个大写的L