Created
October 8, 2013 21:58
-
-
Save timohirt/6892513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println("Hello World") | |
// Vars / static types | |
var v1: String = "Test" | |
v1 = "Test 2" | |
//v1 = 2 -> Fehler, da va bereits Type String | |
// Type inference | |
var v2 = "Variable 2" | |
//v2 = 34 -> Fehler, da Type inference den Type String für v2 erkannt hat. | |
// Vals | |
val v3 = 234 | |
//v3 = 23444 -> Vals sind immutable | |
// Everything is an object | |
val one = 1 | |
val five = 5 | |
// no build-in operators | |
one + five | |
one.+(five) | |
// Scala Strings, format strings | |
s"Dies ist eine ${one}" | |
import java.sql.{Date => SQLDate} | |
new SQLDate(System.currentTimeMillis()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment