> Markdown version of [/videos/512-route-from-java-to-kotlin?t=1201](https://www.wearedevelopers.com/videos/512-route-from-java-to-kotlin?t=1201). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Route from Java to Kotlin Ditch verbose Java boilerplate and Lombok dependencies forever. See how Kotlin’s native null safety and extension functions instantly upgrade your JVM development workflow. - **Speakers:** Christian Woerz - **Event:** WeAreDevelopers LIVE - **Published:** September 21, 2022 - **Duration:** 57:09 - **URL:** https://www.wearedevelopers.com/videos/512-route-from-java-to-kotlin ## Summary This technical walk-through provides a practical transition path for Java developers adopting Kotlin, emphasizing the language's seamless JVM interoperability and its ability to interface natively with existing Java libraries. Through side-by-side live coding, verbose Java patterns are contrasted against their elegant Kotlin equivalents, highlighting immediate syntax improvements like type inference, string templates, and multi-line string trimming. A fundamental conceptual shift showcased is Kotlin’s preference for expressions over statements; constructs like `if`, `when` (Kotlin's advanced pattern-matching replacement for `switch`), and `try-catch` all return values, eliminating the cumbersome mutable variables typically required in standard Java control flows. Function design and null safety represent significant leaps in developer productivity within Kotlin. The language supports top-level functions without wrapper classes, while named and default arguments make traditional method overloading obsolete. Nullability is enforced at the compile level via the type system, removing standard runtime null checks in favor of concise safe calls (`?.`) and the Elvis operator (`?:`). Similarly, native data classes seamlessly auto-generate accessors and boilerplate code, effectively replacing third-party metadata dependencies like Lombok out of the box. The presentation extensively covers Kotlin's refined approach to functional programming and object extension. Lambda expression syntax is highly streamlined, and collection operations evaluate immediately without requiring constant runtime stream generation. Extension functions serve as one of the most powerful paradigms outlined, allowing developers to graft new functionality onto existing or `final` Java classes without complex inheritance architectures. While advanced features like operator overloading enable highly fluent APIs—such as natively using the `+` syntax on a `BigDecimal`—these capabilities must be managed judiciously to maintain readability and avoid unintended behavior in large team codebases. **Keywords:** kotlin vs java, jvm interoperability, type inference, string templates, kotlin when expression, null safety system, elvis operator, top-level functions, named and default arguments, kotlin data classes, extension functions, lambda expressions, operator overloading, functional programming conventions ## Chapters 1. **Introduction to Kotlin and Java interoperability** (00:02) — Overview of Kotlin's multi-paradigm nature and seamless integration with existing Java libraries. 1. **Understanding file extensions and top-level functions** (03:04) — Writing concise Kotlin scripts without wrapping functions inside classes. 1. **Variable types, type inference, and string templates** (04:50) — Using mutable and immutable variables along with string interpolation and multi-line strings. 1. **Using control flow statements as assignment expressions** (08:05) — Assigning the return values of if statements and try-catch blocks directly to variables. 1. **Pattern matching with the when expression** (10:22) — Replacing Java's switch statements with exhaustive pattern matching and type checking. 1. **Function formatting with named and default arguments** (13:31) — Creating concise functions using expression bodies and omitting overloaded methods through default parameters. 1. **Overriding loops with ranges and stepping** (20:01) — Iterating using numeric ranges, exclusive bounds, and reversed sequences. 1. **Immutable lists and destructuring index values** (22:32) — Instantiating collections and splitting index-value pairs directly in loop declarations. 1. **Implementing strong null safety and optional checks** (24:36) — Migrating from Java optionals to explicit nullable types for safely handling absent values. 1. **Writing lambdas and processing lists functionally** (32:41) — Filtering collections using trailing lambdas without relying on heavy stream chains. 1. **Enhancing existing types using extension functions** (37:45) — Adding new methods to final classes and Java types natively without inheritance. 1. **Data classes, custom properties, and operator overloading** (41:44) — Generating boilerplate utility methods alongside customized property accessors and mathematical overrides. 1. **Audience questions on scalability and language features** (46:13) — Inquiries exploring string manipulation techniques, Scala similarities, learning resources, and operator overloading risks. ## Related Moments - [Introduction to Kotlin history and Java ecosystem interoperability](https://www.wearedevelopers.com/videos/384-moving-from-java-to-kotlin) (from "Moving from Java to Kotlin") - [Configuring runtime Java and Kotlin interoperability protocols](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Introduction to the Java and Kotlin ecosystems](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Summarizing the practical engineering advantages of writing Kotlin](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Kotlin language features and null safety](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Recommended resources and frameworks for learning Kotlin natively](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") ## Related Articles - [Using Java 17 latest features in real world projects](https://www.wearedevelopers.com/magazine/121-using-java-17-latest-features-in-real-world-projects) - [Modern Java Switch Expressions](https://www.wearedevelopers.com/magazine/40-modern-java-switch-expressions) - [Modern Java Records](https://www.wearedevelopers.com/magazine/41-modern-java-records) - [Top 10 Java Libraries](https://www.wearedevelopers.com/magazine/364-top-10-java-libraries) ## Related Jobs - [Senior Software Engineer, Android (Earn Experience)](https://www.wearedevelopers.com/jobs/ext/1937627-senior-software-engineer-android-earn-experience) at **Bitpanda** - [Senior Backend Engineer (Java)](https://www.wearedevelopers.com/jobs/ext/19369-senior-backend-engineer-java) at **Bonial International GmbH** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Senior Software Engineer (L3)](https://www.wearedevelopers.com/jobs/ext/1956800-senior-software-engineer-l3) at **Twilio** - [Softwareentwickler Künstliche Intelligenz mit Schwerpunkt Projektkoordination](https://www.wearedevelopers.com/jobs/ext/1247541-softwareentwickler-kunstliche-intelligenz-mit-schwerpunkt-projektkoordination) at **Aok Systems Gmbh** - [Senior Software Developer Java (m/w/d)](https://www.wearedevelopers.com/jobs/39654-senior-software-developer-java-m-w-d) at **Sopra Steria Custom Software Solutions GmbH**