Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#collections #options #scala
use getOrElse() to access a value or a default when no value is present:
If you want to change selection, open document below and click on "Move attachment"

Scala Options
produces the following result: C:/>scalac Test.scala C:/>scala Test show(capitals.get( "Japan")) : Tokyo show(capitals.get( "India")) : ? C:/> Using getOrElse() Method: Following is the example of showing how to <span>use getOrElse() to access a value or a default when no value is present: object Test { def main(args: Array[String]) { val a:Option[Int] = Some(5) val b:Option[Int] = None println("a.getOrElse(0): " + a.getOrElse(0) )


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.