Scala Higher Order Functions

Scala is also a functional programming language and allows the definition of higher order functions. Functions that take other functions as parameters or whose result is a function are called higher order functions (HOF). In Scala functions are treated as first class values which can be passed as parameters and returned as a result. Let …

Scala Higher Order Functions Read More »

Scala Functions

Scala is also a functional language and provides the flexibility to the programmer to use classes and methods as in a object oriented language along with pure functions. Functions in Scala are also objects. This article provides a brief introduction to using functions in Scala. def is keyword used to define functions in Scala. A …

Scala Functions Read More »

Scala Companion Object

This article provides a brief introduction to an interesting concept the Scala Companion Object. Scala doesn’t have static variables and methods. Scala Companion Object can be visualized as a place holder for all the static variable and method needs of a Scala class.  Scala Companion Object has the same name as an associated Scala class …

Scala Companion Object Read More »

Scala Objects

For programmers already familiar with C++ or Java the concept of object in Scala looks interesting. In Scala object is a keyword and implicitly creates a singleton which is guaranteed to be unique. There is a anonymous class created for every object. It is important to note that Scala doesn’t have static methods or fields …

Scala Objects Read More »

Scala Variables

This article provides a quick introduction on using variables in Scala. Mutable Variables In Scala var keyword is used to declare mutable variables whose value can be changed. var iInt : Int = 30 Scala supports type inference where the Scala compiler infers the type of the variable based on the value assigned. For example, …

Scala Variables Read More »

Scala Introduction

This article provides a quick introduction to Scala programming language. What is Scala? Scala is acronym for “Scalable Language”. Scala integrates object-oriented and functional language concepts. Scala is often referred to as object-functional programming language. Scala source code gets compiled to Java byte-code and runs on the Java Virtual Machine (JVM). Java and Scala classes …

Scala Introduction Read More »

Quick start with Scala

This article provides a quick start with Scala and to enables to write your first program with Scala.  Scala Installation Scala Pre-requisites To install the Scala software distribution we need Java run-time version 1.6 or higher. You can check this using “java -version” from the command line. C:\Users\mad>java -versionjava version “1.7.0_45″Java(TM) SE Runtime Environment (build …

Quick start with Scala Read More »

Java RMI

Java RMI Introduction Java Remote Method Invocation (RMI) enables remote communication between programs running across different Java Virtual Machines (JVM). RMI essentially allows an object running in one JVM to invoke a method on another object running in a different JVM. Java RMI provides the ability to write distributed objects in a simple and secure …

Java RMI Read More »

Java Messaging Service (JMS) using ActiveMQ

Java Messaging Service (JMS) Introduction Java Messaging Service (JMS) provides a mechanism for applications to create, send and receive messages using reliable, asynchronous and loosely coupled communication. JMS is defined as part of the Java Enterprise Edition. JMS supports two messaging models, point-to-point model and the publish subscribe model. In the point to point messaging …

Java Messaging Service (JMS) using ActiveMQ Read More »

Java ReentrantReadWriteLock

ReentrantReadWriteLock Introduction A read-write lock provides greater level of concurrency than a mutual exclusion lock when working with shared data. Read-write locks allows simultaneous read only operations by multiple threads whereas a write operation can be performed by only one thread. Read-write locks provide increased level of concurrency and typically results in better performance if …

Java ReentrantReadWriteLock Read More »