Scala:导入scala.io.StdIn.readLIne - 导入错误

时间:2017-02-12 02:37:53

标签: scala

如果我导入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}
  • Scala代码运行器版本2.12.1

如果我不导入此内容,我会收到一条弃用的消息:

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

如果您能帮我解决导入问题,请告诉我。感谢。

1 个答案:

答案 0 :(得分:3)

非常小的忽视:

import scala.io.StdIn.{readLine, readInt}

readLine有一个大写的L