Slide 24
Slide 24 text
ؘఠ ҳઑ
• List, Map, Set ١ collection ٜ
• List(1, 2, 3), Map(1 -> “a”, 2 -> “b”), Set(1, 2)
• Tuple
• val sparkTechTalk = (“2014-12-03”, 50)
• sparkTechTalk._1
• case (key, value) => println(key)
• Option
• ч হਸ ٸ, null न! (؊ ಞೞҊ, উೠ ۽Ӓې߁)
• a = 1, a = null (ӝઓ) a = Some(1) a = None (Optionഝਊ)
• a.nonEmpty, a.getOrElse(0)
• Range
• for (i <- 0 to 10) println(i)
• (0 to 10).foreach(println)
• (0 until 10) (0 to 10) (0 to -10 by -1)