object YuanZuLearn {
//元组的学习
def main(args: Array[String]): Unit = {
val t1 = (1, 2, 3)
val t2 = ("zhansgan", "lisi", 3)
//元组的元素是不可以修改的
println(t1._1)
println(t2._2)
val t3, (a, b, c) = ("wangwu", "zhaoliu", 4)
println(t3)
println(a)
println(b)
println(c)
val t4 = new Tuple3("1", "2", 3)
val t5 = new Tuple5("1", "2", 3, 4, 5)
println(t4)
println(t5)
t5.productIterator.foreach(i => println(i))
t5.productIterator.foreach(println(_))
//拉链
val a1 = Array("java", "js", "scala")
val a2 = Array(1, 2, 3, 4)
println(a1.zip(a2).toString)
val a3 = a1.zipAll(a2, "q", 2)
println(a3)
println(a3.unzip)
}
}