Scala – Tuples

March 26, 2018 admin 1

// Scala – Tuples object Demo { val mytuple = (1, 2, “hello”, true); val mytuple2 = new Tuple3(1, 2, […]

Scala – Maps

March 14, 2018 admin 0

// Scala – Maps object Demo { val mymap : Map[Int, String] = Map(801 -> “max”, 802 -> “Tom”, 804 […]

Scala – Sets

March 3, 2018 admin 0

// Scala – Sets object Demo { val myset: Set[Int] = Set(1,2,5,8,9,6,4); val myset2: Set[Int] = Set(4,2,9,18,19,16,14); val names: Set[String] […]

Scala – Lists

March 3, 2018 admin 0

// Scala – Lists object Demo { val mylist: List[Int] = List(1,2,5,8,9,6,4); val names: List[String] = List(“Max”, “Tom”, “John”); def […]

Scala – Arrays

February 19, 2018 admin 0

// Scala – Arrays import Array._ object Demo { val myarray: Array[Int] = new Array[Int](4); val myarray2 = new Array[Boolean](5); […]

Scala – Closures

January 6, 2018 admin 0

A closure is a function which uses one or more variables declared outside this function. // Scala – Closures /* […]