Month: July 2016
Scala Programming ebooks download
Click on the below links to download the ebooks Programming in Scala, 2nd edition (Artima, 2011, 0981531644)(1) Programming Scala Scala in Depth Scala-Cookbook scala_tutorial Happy learning Scala....:)
Function Currying in Scala
One of the good feature that Scala Supports is function Currying (this concept is taken from Haskell). This feature is least used during Application Development. Now lets explore what is Currying Actually with an example……… scala> def mul(x:Int, y:Int):Int = x*y mul: (x: Int, y: Int)Int scala> mul(2,4) res30: Int = 8… Continue reading Function Currying in Scala
Sets in Scala with examples
Sets are immutable by default in scala. if you to be mutable set then you need to explicitly create them using the fully qualified package like below scala.collection.mutable.Set[String] The differences between List and Set are Lists are ordered and can allow duplicate elements as well Sets are not ordered and will no allow duplicate element… Continue reading Sets in Scala with examples
Cal by value and Cal by name in Scala
What is cal by value and cal by name, most of us will confuse with these two things....cal by value is the default one in java or Scala Will see cal By value and cal by name in Scala with a small example def myname() = { … Continue reading Cal by value and Cal by name in Scala
Scala Collections Package Hierarchy
The following figure shows all collections in package scala.collection. These are all high-level abstract classes or traits, which generally have mutable as well as immutable implementations. The following figure shows all collections in package scala.collection.immutable The following figure shows all collections in package scala.collection.mutable All collection classes are found in the package scala.collection or… Continue reading Scala Collections Package Hierarchy
Methods of List Object in Scala
Creating lists from their elements: List.apply A literal like List(1, 2, 3) is simply the application of the object List to the elements 1, 2, 3. That is, it is equivalent to List.apply(1, 2, 3): scala>List.apply(1, 2, 3) res53: List[Int] = List(1, 2, 3) Creating a range of numbers: List.range scala>List.range(1,10) res37: List[Int] = List(1,… Continue reading Methods of List Object in Scala
Lists in Scala with examples
Scala Lists are always immutable and dynamically growable (but arrays are fixed in Scala once you create with some size ). If you want Mutable List then prefer to use ListBuffer(it is in scala.collection.mutable package). Here will see about creation of List and operations on it. Different ways of Creating a List : Val samplelist… Continue reading Lists in Scala with examples
Scala Developer Cheatsheets
scala-quick-reference Scala-Cheat-Sheet-devdaily Scala_Cheatsheet https://mbonaci.github.io/scala/ http://rea.tech/java-to-scala-cheatsheet/ http://docs.scala-lang.org/cheatsheets/ - Credit to Original Authors
Access Modifiers in Scala
In Scala there are three Access Modifiers Default Private Protected We can apply these Access modifiers to Classes, Objects, Packages and triats. Default - In Scala ,You don’t have to mention Public for a Class or package or object. If you don’t mention anything like private or protected then it will treat as Public Access.… Continue reading Access Modifiers in Scala