Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#collections #scala #tuples

Here is an example of a tuple holding an integer, a string, and the console:

val t = (1, "hello", Console)

Which is syntactic sugar (short cut) for the following:

val t = new Tuple3(1, "hello", Console)
If you want to change selection, open document below and click on "Move attachment"

Scala Tuples
ements Previous Page Next Page Scala tuple combines a fixed number of items together so that they can be passed around as a whole. Unlike an array or list, a tuple can hold objects with different types but they are also immutable. <span>Here is an example of a tuple holding an integer, a string, and the console: val t = (1, "hello", Console) Which is syntactic sugar (short cut) for the following: val t = new Tuple3(1, "hello", Console) The actual type of a tuple depends upon the number and of elements it contains and the types of those elements. Thus, the type of (99, "Luftballons") is Tuple2[Int, String]. Th


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.