Scala – Reduce, fold or scan (Left/Right)
// Scala – Reduce, fold or scan (Left/Right) //reduceLeft, reduceRight, foldLeft, foldRight, scanLeft, scanRight object Demo { val lst = […]
// Scala – Reduce, fold or scan (Left/Right) //reduceLeft, reduceRight, foldLeft, foldRight, scanLeft, scanRight object Demo { val lst = […]
In this Post we will see How to Install Scala, SBT and Java on Ubuntu 18.04 LTS (Linux) Install Java Step 1 […]
// Scala – map and filter object Demo { val lst = List(1, 2, 3, 5, 7, 10, 13); val […]
// Scala – Options (Some or None) object Demo { val lst = List(1, 2, 3); val map = Map(1 […]
// Scala – Tuples object Demo { val mytuple = (1, 2, “hello”, true); val mytuple2 = new Tuple3(1, 2, […]
// Scala – Maps object Demo { val mymap : Map[Int, String] = Map(801 -> “max”, 802 -> “Tom”, 804 […]
// 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 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 import Array._ object Demo { val myarray: Array[Int] = new Array[Int](4); val myarray2 = new Array[Boolean](5); […]
// Scala – String object Demo { val num1 = 75; val num2 = 100.25; val str1 : String = […]
Currying is the technique of transforming a function that takes multiple arguments into a function that takes a single argument. […]
A closure is a function which uses one or more variables declared outside this function. // Scala – Closures /* […]
// Functions in Scala object Demo { object Math { def add(x: Int, y: Int): Int = { return x […]
In Scala match expressions are used to select between a list of alternatives same as multiple if-statements or select statement, […]
In this Post we will see How to Install Scala on Mac OS X. There are Two ways using which we […]
Copyright © 2024 | WordPress Theme by MH Themes