// the find
amitshekhariitbhu/from-java-to-kotlin
From Java To Kotlin - Your Cheat Sheet For Java To Kotlin
A Markdown cheat sheet of side-by-side Java and Kotlin snippets for about 40 everyday patterns, from null checks and string templates to extension functions, data classes, and enums. It is aimed at Android developers who already know Java and want a quick lookup rather than a learning path. The repo is essentially the README; the code under `others/` is a few small example files.
- Most sections put one Java idiom next to its Kotlin equivalent on the same concept, so the comparison is easy to scan. The `when` grade example against the Java switch fallthrough and the bitwise operator table are the clearest.
- It covers the parts that trip up Java developers moving over: `?.let` and `?:` for nulls, `as?` versus `as`, smart casts, and `data class` with `copy()` in place of `clone()`. These are the questions people actually search for.
- Java examples use modern forms where they matter, such as `List.of` and `Map.of` from Java 9 and streams from Java 8, so the sheet doesn't only compare against Java 7 code. The 'Important things to know' list links to deeper posts on coroutines, Flow, and inline functions, so the sheet works as an index.
- Several snippets won't compile as written. `object` is a hard keyword in Kotlin, so `if (object is Car)` and `var car = object` fail. The 'implicit' cast section's comment says `car will be null` on a line where `car` is either a `Car` or null. The sorting example calls `sortedWith` and discards the result, so the list is never sorted.
- Some idioms are dated and not flagged as such. The anonymous-class example uses `AsyncTask`, which has been deprecated since Android 11, and no replacement is shown. Coroutines and Flow appear only as blog links, so the sheet stops where most current Android code starts.
- A sizable part of the README is promotion for Outcome School: the 'About me' block, the live-session section, the repeated join links, and the blog list. The GitHub language label reads 'Java', but the repo is mostly Markdown, and the last push was in January 2026.