We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 297eeb3 + d504017 commit dc906c6Copy full SHA for dc906c6
src/library/scala/util/Try.scala
@@ -24,11 +24,12 @@ import scala.language.implicitConversions
24
*
25
* Example:
26
* {{{
27
+ * import scala.io.StdIn
28
* import scala.util.{Try, Success, Failure}
29
30
* def divide: Try[Int] = {
- * val dividend = Try(Console.readLine("Enter an Int that you'd like to divide:\n").toInt)
31
- * val divisor = Try(Console.readLine("Enter an Int that you'd like to divide by:\n").toInt)
+ * val dividend = Try(StdIn.readLine("Enter an Int that you'd like to divide:\n").toInt)
32
+ * val divisor = Try(StdIn.readLine("Enter an Int that you'd like to divide by:\n").toInt)
33
* val problem = dividend.flatMap(x => divisor.map(y => x/y))
34
* problem match {
35
* case Success(v) =>
0 commit comments