Scala object explained in detail

Welcome to Scala series. In this tutorial, you will learn about Scala object explained in detail. Scala Object is a special type of class. It is a singleton class and it can have only one instance. We cannot create multiple instances of Object. Scala Object is similar to Java Singleton class. In Java, we use the static keyword for a method. […]

Scala class explained in detail

Welcome to Scala series. In this tutorial, you will learn about Scala class explained in detail A Class is a blueprint of an object. A class defines an object. In other words, we can say the class is the template of an object. A Class can have fields, methods, constructors, extends another class or implement an interface or Trait. Class Syntax […]

Scala collection – Arrays

Welcome to Scala series. In this tutorial, you will learn about Scala collection – Arrays. Array is a special type of collection which is used to store the fixed length of data. It is similar to Java Array. If you are a java programmer, then understanding scala array would be simpler. To declare array of integers and String in Scala In […]

Scala function explained in detail

Welcome to Scala series. This tutorial is about the Scala function explained in detail. Scala function is similar to a method but a function doesn’t have any name. It is also called an anonymous function as it not holding a name to it. A function has a sequence of statements which wrapped in a block. Each function performs a certain task […]

Scala method explained in detail

Welcome to Scala series. This tutorial is about the Scala method explained in detail. A method in Scala is a sequence of statements wrapped to form a method. Each method performs a certain task according to its sequence of statements. In Scala, a method can be either written in a class or in an Object. Scala method can have default values […]

How to write Scala main method

Welcome to Scala series. In this tutorial, we will be learning how to write Scala main method. Before learning to write the main method. Let us understand a few basics. Scala is a functional oriented language as well as an object oriented language.To run Scala, you need to have Java installed on your machine. But why Java? Because Scala runs on […]

Scala yield function

Welcome to Scala series. In this tutorial, you will learn about Scala yield function. Scala yield function is used along with for loop comprehensions. Yield function is used for storing data/element of each iteration in a collection. For each iteration of the for loop, yield function helps to store each element in the backend in a buffer or in memory and […]

Scala tuple in detail

Welcome to Scala series.In this tutorial, you will learn about Scala tuple in detail. A tuple is a collection of elements with different data types. We can consider a Tuple as a bag of any elements or a container of elements. Tuple is a powerful structure and one of the key feature of Scala. It is a generic object and doesn’t belong […]

Scala Guard function

Welcome to Scala series. In this tutorial, you will learn about Scala Guard function/statement in detail Guard function/statement is simply a boolean expression. Guard function/statement is mainly used for adding a boolean condition(guard function) in the ‘for loop comprehensions’ itself to filter/match the values. Guard function/statement is a filter condition applied in for loop comprehensions or case statements. By using this, […]

Scala relational operations in detail

Welcome to Scala series. In this tutorial, you will learn about Scala relational operations in detail. Below are the relation operations supported in Scala == (Check whether two values are equal or not.It returns the result as boolean. If equal returns true, else returns false.) != (Check whether the first value is not equal to second value.Returns the result as boolean) […]

Scala arithmetic operations in detail

Welcome to Scala series. In this tutorial, you will learn about Scala arithmetic operations in detail. Arithmetic operations are basically mathematical operations such as Addition.subtraction,division,multiplication and modulo.Scala supports arithmetic operations very well similar to other programming languages and it bit easy  to code it. Below are the basic arithmetic operations supported by Scala + (add two values and generate the result) […]

Scala var vs val keyword

Welcome to Scala series. In this tutorial, you will learn about Scala var vs val keyword. This is one of the key and important concept of Scala and request you to please pay attention to it. Let you Scala journey begun 🙂 1.var keyword is used to mark the variable as mutable.E.g., var is a mutable variable which means it can […]

Scala mutable and immutable variables

Welcome to Scala series.  In this tutorial, you will learn about Scala mutable and immutable variables. This is one of import and key feature of Scala. So please learn this basics to start you Scala journey. Mutable variables What is mutable? – A data defined as mutable can be changed whenever it is required. So in Scala, to defined a data […]

Java 8 stream word count example

Welcome to Java 8 series. In this tutorial, you will learn about java 8 stream word count example. This is a simple Java 8 stream program to identify the number of word occurrences in a list of string. This is a classic example of word count map reduce program. So let us try to solve in Java 8 stream. Let us create a […]