I'm new to scala, and what I'm learning is tuple
.
I can define a tuple as following, and get the items:
val tuple = ("Mike", 40, "New York")
println("Name: " + tuple._1)
println("Age: " + tuple._2)
println("City: " + tuple._3)
My question is:
- How to get the length of a tuple?
- Is tuple mutable? Can I modify its items?
- Is there any other useful operation we can do on a tuple?
Thanks in advance!