Tuples
Let us see tuples in detail A tuple is another data structure in Scala It can hold heterogeneous elements Syntax for tuple val t = (1, “Hello World”) Another syntax for tuple val t: (Int, String) = (1, “Hello World”) Tuple has a handful of methods Elements of tuples can be accessed using _ notation (t._1 will return 1 and t._2 return Hello …