5: ♥ Setting up Scala & practicing the concepts via REPL the Scala way for Java developers

Scala runs on the JVM, so Java and Scala stacks can be freely mixed. You can call Java libraries from Scala. Having said this, it is very important that you learn to write code the Scala way, and Not Java way. Currently, Java programmers with Scala experience are paid more and in demand.

Step 1: Download the latest version of Scala from “http://www.scala-lang.org/”. I downloaded scala-2.11.6 for windows 8 and installed it in “C:\development\scala-2.11.6” same location where my Java 8.

Step 2: Now, if you check your environment variable “path”, it should have “C:\development\scala-2.11.6\bin”. Open a DOS environment, and type

Step 3: Type “scala” on the command prompt to get the “REPL” shell, which stands for Read-Eval-Print-Loop.

:q” to quit the Scala shell. You can practice Scala on this REPL.

Step 4: Entering multi-line commands on REPL by starting with “:paste” and “ctrl+d

Step 5: In the above example, the number1 type was declared as an “Int”. In Scala the data types can be inferred as shown below.

So, REPL is a great way to learn the Scala core concepts to write code the Scala way with free online tutorials and YouTube videos. Search for “Scala tutorials for Java developers“. Learn the concepts like type inference, immutability, functional programming, expressions, pattern matching, case classes, partial function, Option type to prevent NullPointerExceptions, reactive programming, multiple parameter sets, etc.

I will focus more on industrial strength tutorials in Scala with Akka, Spark, reactive programming, etc that empowers you to target low latency and Big Data jobs.

Print Friendly
The following two tabs change content below.
Arulkumaran Kumaraswamipillai
Mechanical Engineering to Java freelancer since 2003. Published Java/JEE books via Amazon.com in 2005, and sold 35K+ copies. Books are outdated and replaced with this online Java training. join my LinkedIn group.
Arulkumaran Kumaraswamipillai

Mechanical Engineering to Java freelancer since 2003. Published Java/JEE books via Amazon.com in 2005, and sold 35K+ copies. Books are outdated and replaced with this online Java training. join my LinkedIn group.

Posted in Setting up Tutorial

600+ Java Interview Q&As ♥Free|♦FAQ

open all | close all

200+ Java Interview FAQs – Memory Joggers

open all | close all

16 Java Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your "Career Skills"?

open all | close all