You are previewing Scala in Depth.

Scala in Depth

Cover of Scala in Depth by Foreword by: Martin Odersky... Published by Manning Publications

Chapter 10. Integrating Scala with Java


In this chapter
  • The benefits of using interfaces for Scala-Java interaction
  • The dangers of automatic implicit conversions of Java types
  • The complications of Java serialization in Scala
  • How to effectively use annotations in Scala for Java libraries


One of the biggest advantages of the Scala language is its ability to seamlessly interact with existing Java libraries and applications. Although this interaction isn’t completely seamless, Scala offers the tightest integration to Java of any JVM language.

The key to knowing how to integrate Scala and Java lies in the Java Virtual Machine specification and how each language encodes onto that specification. Scala does its best to translate simple language ...

The best content for your career. Discover unlimited learning on demand for around $1/day.