Tuples

Originally published at: http://www.itversity.com/topic/tuples/

Let us see tuples in detail 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 have handful of methods Elements of tuples can be accessed using _ notation (t._1 will…