Day1 Scala Crash Course
Day1 Scala Crash Course
This course: mostly Scala, some translations shown to Java & Python
Outline
A picture of a cat
Coffee Break*
What is Scala?
Functions in Scala
Statically typed
● Comparable in speed to Java*
● Type inference saves us from having to write
explicit types most of the time
http://www.scala-lang.org/
Quick Tour of Scala
Declaring variables: Java equivalent:
var x: Int = 7 int x = 7;
var x = 7 // type inferred
val y = “hi” // read-only final String y = “hi”;
// Regular functions
def addTwo(x: Int): Int = x + 2
Quick Tour of Scala Part 2
(electric boogaloo)
…..
Cat picture from http://galato901.deviantart.com/art/Cat-on-Work-Break-173043455