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.

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. 1,350+ paid memberships.

Posted in Setting up & getting started tutorials

Brush-up or learn the basics that will fast-track your career

open all | close all

100+ Java Tutorials by topics

open all | close all