2. Index
▪ Installation of Scala.
▪ Why Scala ?
▪ Interactive Mode & Script Mode
▪ Ease your work with tools
▪ Basic Syntax
▪ Collection in Scala
▪ ScalaTrait
▪ Scala Exception Handling
▪ Design Pattern in Scala
▪ Question/Query
3. Installation in Windows
▪ Download the Zip from scala-lang.org
▪ Set JAVA_HOME & SCALA_HOME & update the path variable
▪ Make sure you have proper Java environment variable setting. As
Scala runs on JVM.
4. Installation in Linux
▪ Download tgz file and unzip it
▪ Set JAVA_HOME & SCALA_HOME & update the path variable
5. Index
▪ Installation of Scala.
▪ Why Scala ?
▪ Interactive Mode & Script Mode
▪ Ease your work with tools
▪ Basic Syntax
▪ Collection in Scala
▪ ScalaTrait
▪ Scala Exception Handling
▪ Design Pattern in Scala
▪ Question/Query
6. Why Scala…?
▪ Solving business problem instead of writing boiler plate code
▪ Support for functional programming.
▪ REPL : 60% code reduction.
▪ Design patterns are encapsulated in the Language itself
▪ Truly Object Oriented . Even functions are Objects: All the value in Scala are
object inherited from ANY class
▪ Runs on JVM So existing code is not necessarily to be scrap
▪ ; is optional. Only needed if you want to evaluate two or more expr in same
line.
▪ Value variable(immutable & default REPL) & variable variable (mutable val )
11. Scala in action (Script Mode)
▪ Create a file in notepad, write the following code and save it with
.scala extension .
▪ Compile it & run it with scalac & scala respectively
12. Index
▪ Installation of Scala.
▪ Why Scala ?
▪ Interactive Mode & Script Mode
▪ Ease your work with tools
▪ Basic Syntax
▪ Collection in Scala
▪ ScalaTrait
▪ Scala Exception Handling
▪ Design Pattern in Scala
▪ Question/Query
13. ▪ Install the simple build tool (sbt) & eclipse IDE/plugin for scala.
▪ Fire console
15. Index
▪ Installation of Scala.
▪ Why Scala ?
▪ Interactive Mode & Script Mode
▪ Ease your work with tools
▪ Basic Syntax
▪ Collection in Scala
▪ ScalaTrait
▪ Scala Exception Handling
▪ Design Pattern in Scala
▪ Question/Query
16. Basic Syntax of Scala
Object type Syntax Example
Variable var <variableName>=<value> var x=12; var x:Double=12 (ExplicitType)
Constant val <variableName>=<value> val x=12
Funcation def <functionName> (<Variable Name> :<VariableType>) ={
<function definition>}
17. Basic Syntax of Scala
For Syntax in detail please check the scala cheetsheet @ http://docs.scala-
lang.org/cheatsheets/index.html
Object Name Syntax Example
18. Index
▪ Installation of Scala.
▪ Why Scala ?
▪ Interactive Mode & Script Mode
▪ Ease your work with tools
▪ Basic Syntax
▪ Collection in Scala
▪ ScalaTrait
▪ Scala Exception Handling
▪ Design Pattern in Scala
▪ Question/Query
19. Introduction of String in Scala
Group A
• Task 1
• Task 2
Group B
• Task 1
• Task 2
Group C
• Task 1
▪ First bullet point here
▪ Second bullet point here
▪ Third bullet point here