Книга: Learn Scala for Java Developers
Назад: Generics
Дальше: Faking Function Calls

III. Beyond Java to Scala

This part of the book is all about the differences between Scala and Java. There are plenty of language features in Scala that don’t have an obvious analog in Java. In this part, we’ll take a closer look at some of those and explore what Scala can give us over Java.

Specifically, we’ll explore some of the language features that make writing Scala more expressive and we’ll look at some of the more functional programming idioms that Scala is so well know for.

Expressive Scala

Scala offers several features that make writing code more concise. As well as some we’ve already seen, it provides mechanisms to:

Scala also offers pattern matching; we’ll look at the unapply method and its role in pattern matching.

Functional Programming Idioms

We’ll also look at some of functional programming aspects of Scala.

This only scratches the surface of functional programming but I hope that this part of the book will give you a useful head start when it comes to Scala and functional programming.

Назад: Generics
Дальше: Faking Function Calls