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 ...

Get Scala in Depth now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.