You will be surprised to know that you can also create Scala script and execute it on Windows OS(as a bat script) as well as on Linux/Unix OS(as a shell script) without any compilation. Continue reading “How to execute Scala Script on Windows and Unix”
Category: Scala
Scala
Scala Exception Handling by Code Examples
Scala Exception handling is mostly very similar with Java exception handling except catch block syntax. Here I am just trying you to explain Scala exception handling concept in brief as it is a very vast topic in itself. Continue reading “Scala Exception Handling by Code Examples”
Scala Pattern Matching expression with Code Examples
I am sure that if you have come across Java programming language, you might have used switch case statements in Java. Scala pattern matching expression is quite similar with Java switch-case statements, and provides far more features than that. Continue reading “Scala Pattern Matching expression with Code Examples”
Understanding Option Class in Scala
While programming in Java(earlier versions the Java 8), majority of us have come across a situation here we get NullPointerException
. It happens because many times we write a code without checking all possibilities and method returns null value under certain conditions. Continue reading “Understanding Option Class in Scala”
Scala Collections : Map and Tuple with Code Examples
Same as Java Map, Scala Map is the collection(Iterable) of various key and value pairs in Scala Collections. All keys in Map are unique and associated with a value. Same as List and Set, Scala Maps are also having two types immutable and mutable. Continue reading “Scala Collections : Map and Tuple with Code Examples”
Scala Collections : List with Code Examples
After the brief introduction on Scala Collections, let’s move on by looking at the List first. List is the most commonly used collection class in any programming language. List can be used same as Array but the size of list grows dynamically. Continue reading “Scala Collections : List with Code Examples”
Scala Collections Overview
Scala collection framework is a set of very rich and user friendly collection classes. And functional capabilities of Scala makes these collections safe, easy to use, concise, fast and universal. Here in this post we’ll take an overview of Scala collection classes. Continue reading “Scala Collections Overview”
Scala Arrays by Code Example
Array is a very basic building block of any programming language. Arrays can be treated as static, sequential and fixed size collection of any type in Scala. One important point to note here is ” Scala Arrays are mutable “. Continue reading “Scala Arrays by Code Example”
Stackable Modifications using Traits in Scala
In one of my previous post about Traits in Scala, I have pointed out one sentence that abstract classes and traits in Scala are Stackable. So what does that mean? Let me elaborate a bit on that part. Continue reading “Stackable Modifications using Traits in Scala”