Posts

Showing posts with the label Scala Tutorial

Scala Tutorial | Scala Variables Example

Image
The Scala stands for "Scalable Language" is a pure object oriented with fully supported functional programming language. Scala is concise and very much comparable with Java programming language. The origin of Scala is mix of many languages like Java, C#, C++, Haskell etc. Scala runs on JVM(Java Virtual Machine), Scala source code compiled into byte code similar to Java, you can easily mix Java code inside Scala or you can use Java libraries inside you Scala project. Although Scala is very much similar to Java but still it has some differences which makes it more demanding in a very short period of time unlike other languages. Here is detailed differences between Scala and Java Scala Vs Java In this tutorial, I am going to show you What is Scala Variables and different types of Variables in Scala like var, val, lazy with example. In Scala variables comes in three different variety- var val lazy val var A variable with mutable state or you can say mutable variab...

Scala Tutorial | Scala Lazy Evaluation Example

Image
The Scala stands for "Scalable Language" is a pure object oriented with fully supported functional programming language. Scala is concise and very much comparable with Java programming language. The origin of Scala is mix of many languages like Java, C#, C++, Haskell etc. Scala runs on JVM(Java Virtual Machine), Scala source code compiled into byte code similar to Java, you can easily mix Java code inside Scala or you can use Java libraries inside your Scala project. Although Scala is very much similar to Java but still it has some differences which makes it more demanding in a very short period of time unlike other languages. Here is detailed differences between Scala and Java Scala Vs Java We have already seen how many types of variables are available in Scala and when to use them with step by step guide at here . And, In this article, I am going to show you a simple example of lazy evaluation in Scala. Lazy evaluation Scala lazy val are calculated on demand when they...

Scala Tutorial | Hello World in Scala using Eclipse

Image
The Scala stands for "Scalable language", Scala is pure object oriented programming language as well as fully supported functional programming. Scala is concise and very much compatible with Java programming language. The syntax of Scala is very much similar to Java, one can easily mix both Scala and Java code in one place. It's a high level language with strongly statically typed, the execution model of Scala is derived from Java. For more on Scala overview you may read this and for Scala installation you may read Scala installation guide . Although Scala is very much similar to Java, but still it has various differences that's why nowadays Scala is on demanding, for detailed differences between Scala and Java read Scala vs Java separate post. In this tutorial, I am going to show you an example of Hello World program in Scala using eclipse IDE. Step 1: Open IDE,Go to File->New->Scala Project It will ask for project name, provide the project name and cl...

Scala Tutorial | Scala Vs Java

Image
Scala is getting much and more popular, and become one of the favourite alternative of Java that's the reason why Scala grown exponentially. Scala syntax is very much similar to Java, and the best is that Scala runs on JVM(Java Virtual Machine), that means Scala is fully compatible with Java syntax, one can easily mix both code Scala and Java on same class.We have already seen an overview of Scala in my previous article . After compiling the Scala code, it will generate the .class file similar to Java, which makes it write once run anywhere compatible, even you will get all the objects/method of java.lang package by default into Scala code. Although Scala is very much similar to Java, but still has some major differences, which caused the invention of Scala, and those are listed below. Differences between Scala and Java 1. Scala is pure object oriented with fully support of functional programming The first and major difference between Scala and Java is that, Scala is pure ...

Scala Tutorial | Scala installation | Scala IDE installation | Set up Scala Environment

Image
Scala is getting much and more mature, nowadays it becomes industry demanding technology. Although syntax is very much similar to Java, but what Scala makes different from Java is, it's fully supported functional programming as well as pure object oriented language, there is nothing so called primitive in Scala. Here is a detailed differences between Java and Scala . Anyway, we are here to share the Scala installation steps. If you are very new to Scala than, I must say visit this link to catch the glimpse of Scala. The Scala installation guide is very much similar to Java installation . In this article, I will show you how to install Scala SDK and than Scala IDE with Hello world program, for detail explanation of Hello World program must visit this link . Steps to install Scala SDK Before scala installation, install Java, if you have not already installed Java than follow this step-by-step guide to install java . Verify java installation : java -version The above com...

Scala Tutorial | Scala Overview

Image
The Scala is an acronym for scalable language. It's a pure object oriented programming language with support of functional programming. Scala runs on the JVM(Java Virtual Machine) as well as on android you can mix both Java and Scala code in same project/class. Scala compiler includes Java compilers/libraries. Scala began it's life in near 2003, created by Martin Odersky and his team at EPFL, Scala has since grown into a mature open source programming language and today become one of the popular open source for industry and used by some big companies like Linkedin, Twitter, Intel and many more. Copied from Scala is a pure-bred object-oriented language. Conceptually, every value is an object and every operation is a method-call. The language supports advanced component architectures through classes and traits. Scala syntax is very much similar to Java, It's a Java like programming language which unifies object oriented and functional programming. Scala current s...