- Android Development with Kotlin
- Marcin Moskala Igor Wojda
- 256字
- 2021-07-02 18:48:32
Java to Kotlin converter (J2K)
Migration of existing Java projects is also quite easy, because we can use Java and Kotlin side by side in the same project. There are also ways to convert existing Java code into Kotlin code by using the Java to Kotlin converter (J2K).
The first way is to convert whole Java files into Kotlin files using the convert Java File to Kotlin command (the keyboard shortcut in Windows is Alt + Shift + Ctrl + K and in macOS is option + shift + command + K), and this works very well. The second way is to paste Java code into an existing Kotlin file and the code will also be converted (a dialog window will appear with a conversion proposition). This may be very helpful when learning Kotlin.
If we don't know how to write a particular piece of code in Kotlin, we can write it in Java, then simply copy to the clipboard and paste it into the Kotlin file. Converted code will not be the most idiomatic version of Kotlin, but it will work. The IDE will display various intentions to convert the code even more and improve its quality. Before conversion, we need to make sure that the Java code is valid, because conversion tools are very sensitive and the process will fail even if a single semicolon is missing. The J2K converter combined with Java interoperability allows Kotlin be introduced gradually into the existing project (for example, to convert a single class at a time).
- C# 7 and .NET Core Cookbook
- Angular UI Development with PrimeNG
- 數(shù)據(jù)庫原理及應用(Access版)第3版
- GraphQL學習指南
- Mastering QGIS
- HTML5游戲開發(fā)案例教程
- PLC編程及應用實戰(zhàn)
- C#程序設計
- Asynchronous Android Programming(Second Edition)
- Extreme C
- 計算機應用基礎教程(Windows 7+Office 2010)
- OpenCV with Python By Example
- Scratch·愛編程的藝術家
- PrimeFaces Blueprints
- Advanced UFT 12 for Test Engineers Cookbook