Kotlin for Java Developers: Confidently transition from Java to Kotlin through hands-on examples and idiomatic Kotlin practices
暫譯: Java 開發者的 Kotlin:透過實作範例與慣用 Kotlin 實踐自信轉換至 Kotlin
Castillo, José Dimas Luján, Veen, Ron
- 出版商: Packt Publishing
- 出版日期: 2025-10-31
- 售價: $1,510
- 貴賓價: 9.5 折 $1,435
- 語言: 英文
- 頁數: 414
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1835884822
- ISBN-13: 9781835884829
-
相關分類:
Java 相關技術
海外代購書籍(需單獨結帳)
相關主題
商品描述
Written by José Dimas Luján Castillo and Ron Veen - seasoned developers with deep expertise in Java and Kotlin - this practical guide teaches Kotlin through side-by-side Java comparisons, real-world examples, and clear explanations of modern language features.
Key Features:
- Learn Kotlin by drawing direct comparisons to core Java concepts
- Understand null safety, coroutines, extension functions, and DSLs through practical examples
- Use Kotlin confidently in backend, Android, and cross-platform development
- Purchase of the print or Kindle book includes a free PDF eBook
Book Description:
This book is a hands-on programming guide for Java developers who want to gain practical, production-ready knowledge of Kotlin. Whether you're maintaining Java systems or adopting Kotlin for Android, backend, or cross-platform projects, it will help you bridge the gap by building on your existing understanding of Java's syntax and design principles.
You'll begin by learning why Kotlin was created and how it improves on Java - exploring types, expressions, control flow, and null handling while mapping each concept to familiar Java constructs. Each topic is introduced with clear purpose, showing how Kotlin's concise syntax, safety features, and expressive APIs lead to cleaner, more maintainable code.
As you progress, you'll master object-oriented and functional programming, extension functions, smart casting, and interoperability with Java. The second half of the book dives into generics, data and sealed classes, coroutines for concurrency, and DSL design - demonstrating when and why to use these features to build scalable, elegant solutions.
By the end, you'll not only write idiomatic Kotlin but also understand the reasoning behind its design, enabling you to craft modern, reliable applications with confidence.
What You Will Learn:
- Write Kotlin programs using variables, functions, and control flow
- Model real-world data with classes, properties, and constructors
- Handle missing data safely with nullable types and safe calls
- Simplify logic using lambdas and extension functions
- Work with Kotlin collections and sequences to process data efficiently
- Use Kotlin with Java, Gradle, and Maven for seamless project builds
- Write non-blocking code using coroutines and Async flows
- Create custom DSL for your projects
Who this book is for:
This book is for software developers who are proficient in Java and want to learn Kotlin for professional application development. It's especially relevant for Android engineers, JVM backend developers, and full-stack programmers who maintain or extend Java systems. Familiarity with core Java syntax and object-oriented programming is expected.
Table of Contents
- An Introduction to Kotlin and Its Basic Types
- Interoperability, Gradle, and Maven
- Null and Non-Nullable Types
- Extension Functions and the Apply Function
- Object-Oriented Programming Basics
- Generics and Variance
- Data and Sealed Classes
- Basics of Functional Programming
- Lambda
- Collections and Sequences
- Coroutines
- Synchronous and Asynchronous Programming
- Kotlin Testing
- Domain-Specific Languages in Kotlin
商品描述(中文翻譯)
本書由 José Dimas Luján Castillo 和 Ron Veen 撰寫,他們是擁有深厚 Java 和 Kotlin 專業知識的資深開發者。本實用指南通過 Java 的並排比較、真實世界的範例以及對現代語言特性的清晰解釋來教授 Kotlin。
主要特點:
- 通過直接比較核心 Java 概念來學習 Kotlin
- 通過實際範例理解空值安全、協程、擴展函數和 DSL
- 在後端、Android 和跨平台開發中自信地使用 Kotlin
- 購買印刷版或 Kindle 書籍可獲得免費 PDF 電子書
書籍描述:
本書是針對希望獲得實用、可投入生產的 Kotlin 知識的 Java 開發者的實作編程指南。無論您是在維護 Java 系統,還是為 Android、後端或跨平台項目採用 Kotlin,本書都將幫助您通過建立在現有 Java 語法和設計原則的理解上來彌補差距。
您將首先學習 Kotlin 為何而創建以及它如何改進 Java,探索類型、表達式、控制流程和空值處理,同時將每個概念映射到熟悉的 Java 結構。每個主題都以清晰的目的引入,展示 Kotlin 的簡潔語法、安全特性和表達性 API 如何導致更乾淨、更易於維護的代碼。
隨著進展,您將掌握面向對象和函數式編程、擴展函數、智能類型轉換以及與 Java 的互操作性。本書的後半部分深入探討泛型、數據類和密封類、用於並發的協程以及 DSL 設計,演示何時以及為何使用這些特性來構建可擴展、優雅的解決方案。
到最後,您不僅能夠編寫符合慣用法的 Kotlin,還能理解其設計背後的原因,使您能夠自信地構建現代、可靠的應用程序。
您將學到的內容:
- 使用變量、函數和控制流程編寫 Kotlin 程式
- 使用類、屬性和構造函數建模現實世界數據
- 使用可空類型和安全調用安全地處理缺失數據
- 使用 Lambda 和擴展函數簡化邏輯
- 使用 Kotlin 集合和序列高效處理數據
- 與 Java、Gradle 和 Maven 一起使用 Kotlin 以實現無縫項目構建
- 使用協程和非阻塞流編寫非阻塞代碼
- 為您的項目創建自定義 DSL
本書適合誰:
本書適合精通 Java 的軟體開發者,並希望學習 Kotlin 以進行專業應用開發。特別適合維護或擴展 Java 系統的 Android 工程師、JVM 後端開發者和全棧程序員。預期讀者對核心 Java 語法和面向對象編程有一定的熟悉度。
目錄
- Kotlin 及其基本類型介紹
- 互操作性、Gradle 和 Maven
- 空值和非空值類型
- 擴展函數和 Apply 函數
- 面向對象編程基礎
- 泛型和變異性
- 數據類和密封類
- 函數式編程基礎
- Lambda
- 集合和序列
- 協程
- 同步和異步編程
- Kotlin 測試
- Kotlin 中的領域特定語言