Java Interop
- Calling Java. Scala calls Java seamlessly: same objects, same libraries, no bridge code.
- Converters. Collection converters: asScala, asJava: translate at the boundary, explicitly.
- Null at the border. Java may return null: wrap it in Option at the boundary, immediately.
Runtime Behaviour
- Same JVM rules. Scala obeys JVM physics: JIT, GC and profiling knowledge carries straight over.
- Boxing awareness. Generics can box primitives: hot numeric paths measured, specialised where proven.
- Stack safety. Deep recursion overflows: tail recursion (checked by annotation) or trampolines keep it safe.
Mixed JVM Systems
- Gradual adoption. Scala adopts gradually: one module in a Java build, both compiling together.
- Exposing Scala to Java. Scala APIs surface to Java politely: avoiding implicit-heavy signatures at the border.
- One build. sbt, Gradle or Maven build mixed sources: interop as build reality.
Before and after this level
- Before: Level 9: Concurrency: Futures, Concurrent Programming, Functional Concurrency Patterns.
- Next: Level 11: Build & Testing: SBT, Testing, Package and Module Design.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Scala Level 10: JVM Interoperability cover?
Java Interop, Runtime Behaviour, Mixed JVM Systems: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 9: Concurrency, which covers Futures, Concurrent Programming, Functional Concurrency Patterns.