Ways to run Scala code

For running example in this tutorial, make sure that, you have latest Java distribution andĀ Scala distributionĀ installed on your machine and environment variable SCALA_HOME points to base directory of the Scala installation and %SCALA_HOME%/bin added to PATH variable. Using Scala REPL It is basically command line interactive shell called as REPL short for Read-Eval-Print-Loop. To start…

Scala in IntelliJ IDE

IntelliJ IDEA lets you run Scala Console to quickly evaluate an expression or a code selection. NOTE the differences from using Scala SDK terminal: If you want the console to execute when you hit enter, go to Preferences > Keymap > Plug-ins > Scala, and right-click ScalaConsole.Execute. Select Add Bookmark and hit enter in the…

Scala

Scala for Java Developers Scala type hierarchy Basic Types and Operations 127 – The convention is to include empty parentheses when invoking a method only if that method has side effects Pure methods are methods that don’t have any side effects and don’t depend on mutable state (226) if the function you’re calling performs an…