Tutorial by Examples

In Scala (in contrast to Java and most other languages), if is an expression instead of a statement. Regardless, the syntax is identical: if(x < 1984) { println("Good times") } else if(x == 1984) { println("The Orwellian Future begins") } else { println("Po...

Page 1 of 1