How to use lazy val in Scala and what is the difference between lazy val and val ?

How to use lazy val in Scala and what is the difference between lazy val and val ?
DeeKay September 30, 2011 at 12:03 am · Scala

Difference between val and lazy val is that, a val is executed when it is defined whereas lazy val is executed when it is accessed for the first time. Below example shows how to use val and lazy val –


Symbols used in Syntax of Scala Language

Symbols used in Syntax of Scala Language
DeeKay September 25, 2011 at 2:47 am · Scala

Scala Lang has many different symbols used in its syntax. Below is the list of symbols and its use in Scala language. “->” arrow symbol in Scala syntax returns a two element tuple containing the key and value. You can use this symbol as shown in below example- Map(1->”Allan”, 2->”Bob”) (1).->(“A) “_” underscore symbol  in scala syntax is intended as…
Continue Reading »


How to Install Scala 2.9.1 on Linux (Ubuntu 11.04) ?

How to Install Scala 2.9.1 on Linux (Ubuntu 11.04) ?
DeeKay September 25, 2011 at 1:07 am · Scala

To install Scala on Linux you need to get scala on your Linux machine. You can get Scala by below two methods : 1) Default Scala version available on your Linux box by typing below command sudo apt-get install scala 2) If you want to get the latest version of the scala below are the…
Continue Reading »


Scala Language Development Tools by Twitter provided as Open Source

Scala Language Development Tools by Twitter provided as Open Source
DeeKay September 1, 2011 at 1:49 am · Scala

Twitter is built on open-source software—here are the projects released or contributed by them. 1.      KESTRAL Kestrel is based on Blaine Cook’s “starling” simple, distributed message queue, with added features and bulletproofing, as well as the scalability offered by actors and the JVM. Each server handles a set of reliable, ordered message queues. When you…
Continue Reading »


Compile Scala Program using Ant Library

Compile Scala Program using Ant Library
DeeKay March 22, 2011 at 2:53 am · Code Examples

http://jakarta.apache.org/ant/. Ant allows the developer to automate the repeated process involved in the development of Java/Scala application. Developers can easily write the script to automate the build process like compilation, archiving and deployment.  


Scala Specs now Superseded by Scala Specs2

Scala Specs now Superseded by Scala Specs2
DeeKay March 16, 2011 at 4:13 am · Scala

The Owner of SPECS project commented on my previous post Development Tools available for Scala Language saying that new version of Specs2 is available. Let me briefly drive you in this. SPECS is the Behavior Driven Design Framework which works as an alternative for Junit when specifying or testing Scala projects. Now the SPEC project…
Continue Reading »


Difference between Scala val and var

Difference between Scala val and var
DeeKay February 23, 2011 at 7:45 pm · Scala

In Scala Language you can define a variable using either a val or a var keyword. The variables defined using val keyword are immutable and can’t be changed after initialization. And the variable defined using var keyword are mutable and can be changed any number of times until it is present in the scope. The immutability applies…
Continue Reading »


Scala Code For Reading File

Scala Code For Reading File
DeeKay February 4, 2011 at 6:44 pm · Code Examples

There are many ways reading file in using Scala language. I will walk-through the options available for reading the file. If anyone wants to add improvements in below code example please feel to add it in the comment. This Scala code is tested on large file and it works fine. /** * Scala code to read the…
Continue Reading »


Your First Application in Scala – Video Tutorial

Your First Application in Scala – Video Tutorial
DeeKay February 3, 2011 at 1:07 am · Scala

Scala is a hybrid functional and object-oriented language. When creating a multithreaded application in Scala, you’ll lean toward a functional style of programming where you write lock-free code with immutable state. Scala provides an actor-based message-passing model that removes the pain associated with concurrency. Using this model, you can write concise multithreaded code without the…
Continue Reading »


Scala Traits and Java Interfaces – Video Tutorial

Scala Traits and Java Interfaces – Video Tutorial
DeeKay February 2, 2011 at 4:18 am · Scala

This video clip explains what happens when we develop a trait (that includes both abstract and concrete methods) in Scala and compile it. The outcome is an interface in Java together with a class. For each one of the concrete methods the traits includes we will find a static method within that class. We can…
Continue Reading »