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 and pick [...]
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 in Scala “object” is a keyword and represents a totally [...]
Tweet 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 concepts have been divided into varying difficultly levels and [...]
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 function values. The are similar to the Objects [...]
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 previous post here-
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 Series of posts ;)). In this post lets talk [...]
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.
Nothing is a Trait. Its a subtype of [...]
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 features will be explained in the article.
Tweet 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 statement if the termination is obvious by line ending. [...]
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, which means that the value from If-Statements can be [...]
Connect to us …
- Simple Aspect Oriented Programming (AOP) using CDI in JavaEE August 24, 2014
- Book Review: Java Performance by Charlie Hunt and Binu John August 20, 2014
- Getting started with Mocking in Java using Mockito February 23, 2014
- Another sample for using JAXB November 24, 2013
- Book Review: Peopleware October 25, 2013
Some of the links contained within this site have my referral id, which provides me with a small commission for each sale. Thank you for your support.