object Demo { def disp(x : Option[Int]) { println(x.isEmpty) println(x.getOrElse(0)) } def main(args : Array[String]) { var b = Map("Hannah" -> 12, "Hadley" -> 1); disp(b.get("Hannah")); // false, 12 disp(b.get("Lin")); // true, 0 } }