Previously I had written about Companion classes in Scala and there in I had mentioned one of its uses i.e defining the apply method to support object literals. In this post I am continuing from where I had previously left… Read More ›
Scala
Brief overview of An “object” in Scala
In Java world we are all familiar with the term object and interchangeably use it with the term instance. Both these terms represent initialization of a class with the required parameters. But the same cannot be applied in Scala, because… Read More ›
Book Review: Scala for the Impatient
The book covers almost all of the concepts in Scala in a very concise format. More emphasis on learning by doing. Lot of exercise problems at the end of each chapter. It is highly recommended to try them out. The… Read More ›
Partially applied functions in Scala
Before going into Partially applied Functions, let me introduces 2 terms- Function Literal- This exists in the source code- Something similar to Class definition. So we have Function value- When this function literal is assigned to a reference they become… Read More ›
Brief insight into Constructors in Scala
In the previous post here, I had introduced few concepts related to constructors in Scala. In this post I would go a bit deeper into the constructors and how we can provide different constructors. Summarizing about the introduction in the… Read More ›
Object Oriented Programming in Scala- 1
Scala uses both Object oriented and functional programming concepts. For folks coming from the Java, we would always explore how to do OOP in Scala. Here I thought of writing few posts related to OOP in Scala (may be a… Read More ›
Null, null, Nil, Nothing, None, and Unit in Scala
Null– Its a Trait. null– Its an instance of Null- Similar to Java null. Nil– Represents an emptry List of anything of zero length. Its not that it refers to nothing but it refers to List which has no contents…. Read More ›
Traits in Scala- Deep Dive
Traits are units of code reuse in Scala. Traits encapsulates methods and field definitions. Their role is similar to that of interfaces in Java- A workaround for Multiple Inheritance. But unlike Interfaces they can have method and field definitions. More… Read More ›
How’s Scala different from Java?
Scala is statically type like Java but with Type Inferencing support. Which means that the scala compiler analyzes the code deeply to determine what type a particular value is. In Scala its not required to use semicolons to terminate a… Read More ›
Control Structures in Scala- A brief overview
If Statements: Lets consider a first entry example of If statments, without using much of Scala’s features. This is a pretty simple and straight forward examples. Now lets add some Scala flavor in the If-Statement. In Scala If-Statements are expressions,… Read More ›