O'Reilly logo

Scala for Java Developers: A Practical Primer by Toby Weston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Key Syntactical Differences
This part of the book is about the key differences between Java and Scala language syntax. Given some typical Java code, we’ll look at equivalent Scala syntax. In Part III, we’ll look more at Scala features for which there is no direct equivalent in Java.
We’re going to look at the following:
  • Lots of things around classes and objects, creating classes, fields, and methods. We’ll do some round-tripping from Scala-generated bytecode back to Java, so that you can get a feel for how Scala relates to Java.
  • Inheritance, interfaces, abstract classes, and mixins.
  • Common control structures like for loops.
  • Generics.

Flexibility

Scala is very flexible . There are generally several ways to achieve the same thing. I don’t mean the difference ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required