Java for Scala Developers

A practical guide for Scala developers learning modern Java 21+. Compare Java Records, Pattern Matching, Virtual Threads with Scala case classes, match expressions, and more.

Latest Posts

Post Timeline

Dec 03, 2025

Tricky Java Patterns That Everyone Uses But Few Understand

Have you ever copy-pasted code from StackOverflow that “just works” but wondered why it’s written that way? Java has several...

Dec 01, 2025

Comparing JVM Test Frameworks: JUnit 5, ScalaTest, and Kotest

Testing is a critical part of software development on the JVM. This comprehensive guide compares the three most popular test...

Nov 29, 2025

String Templates (Preview) - Safe String Interpolation

This is Part 8 of our Java 21 Interview Preparation series. We’ll explore Java 21’s String Templates preview feature, build...

Nov 29, 2025

Local Variable Type Inference with var

This is part of our Java 21 Interview Preparation series. We’ll explore local variable type inference using Java’s var keyword...

Nov 29, 2025

Foreign Function and Memory API in Java 21

Java 21 introduces the Foreign Function and Memory (FFM) API as a stable feature, providing a modern alternative to JNI...

Nov 29, 2025

Null-Safe Programming with Optional

This is Part 4 of our Java 21 Interview Preparation series. We’ll explore the Optional API and null-safe programming patterns,...

Nov 29, 2025

Virtual Threads and Structured Concurrency in Java 21

Project Loom brings revolutionary changes to Java concurrency with virtual threads and structured concurrency. In this post, we’ll migrate a...

Nov 29, 2025

Stream API Advanced Operations

This is Part 4 of our Java 21 Interview Preparation series. We’ll explore advanced Stream operations and collectors, comparing Java...

Nov 29, 2025

Functional Interfaces and Lambda Expressions

Functional programming is a core paradigm in modern software development. This post explores how Java, Scala, and Kotlin handle functional...

Nov 29, 2025

Collection Factory Methods and Stream Basics

This is Part 3 of our Java 21 Interview Preparation series. We’ll explore modern collection factory methods (Java 9+) and...

Nov 29, 2025

CompletableFuture and Asynchronous Programming

Asynchronous programming is essential for building responsive, high-performance applications. This post explores how Java, Scala, and Kotlin handle async operations,...

Nov 28, 2025

String Manipulation with Modern APIs

This is Part 2 of our Java 21 Interview Preparation series. We’ll explore modern String API enhancements introduced in Java...

Nov 28, 2025

Sealed Classes and Exhaustive Pattern Matching

Sealed classes are a powerful feature for type-safe domain modeling. Java 17 introduced sealed classes and interfaces, bringing Java closer...

Nov 26, 2025

Immutable Data with Java Records

This is the first post in our Java 21 Interview Preparation series. We’ll explore Java Records, one of the most...

Nov 25, 2025

Java 21 Interview Preparation Plan

This post outlines a comprehensive plan for preparing for a Java Senior Developer interview, especially for developers who haven’t worked...

Nov 23, 2025

Pattern Matching in Java 21

Pattern matching is one of Scala’s killer features. Java has been steadily adding pattern matching capabilities, and Java 21 brings...

Nov 23, 2025

Java Records vs Scala Case Classes

One of the most beloved features of Scala is the case class. Java 16+ introduced Records, which provide similar functionality....

Nov 22, 2025

Welcome to Java for Scala Developers

Welcome to the Java for Scala Developers blog! This is a practical guide for Scala developers who want to learn...

Welcome to the practical guide for Scala developers who want to learn (or re-learn) Java!

This blog covers modern Java features, comparing them with their Scala equivalents, and providing practical examples to help you transition between the two languages.

Modules

This repository contains examples in multiple languages:

Latest Posts