10a. ♥ 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.

share...Share on LinkedIn2Share on Google+0Share on Facebook0
The following two tabs change content below.
Arulkumaran Kumaraswamipillai
Mechanical Engineer to freelance Java developer within 3 years. Freelancing since 2003 for the major banks, telecoms, retail & government organizations. Attended 150+ Java job interviews, and most often got 3-6 job offers to choose from. 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.
What An Excellent Book!

I have got a copy of your book last week. It is really an incredible book that I have ever seen. I have seen so many Java books like Deitel, Ivor Horton. They are also good. But the book of yours can give me an overall bird-eye view of the Java Environment together with so many useful questions. I am totally impressed with the way you have learned Java.

Yours Sincerely
Ye Tun Oo ( More )

Arulkumaran Kumaraswamipillai

Mechanical Engineer to freelance Java developer within 3 years. Freelancing since 2003 for the major banks, telecoms, retail & government organizations. Attended 150+ Java job interviews, and most often got 3-6 job offers to choose from. 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 & getting started tutorials

800+ Interview Q&As – ♥ Free | ♦ FAQs

open all | close all

Pressed for time? 200+ Quick Prep

open all | close all

16 Technical Key Areas to be a top-notch

open all | close all

100+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your

open all | close all