From Java to Kotlin: life without static

TL; DR Java developers new to Kotlin are often confused by the lack of static members. Which options Kotlin provides in order to replace the static keyword? Let's summarize for easy reference: Java static… Replace with… void main() Top-level function Constants Top-level constants Methods in utility class Top-level functions Factory methods Companion object functions Private methods Private companion object functions or private top-level functions in same file Singleton accessors Object instance Continue reading for the details. [Read More]
kotlin  java 

Java interoperability: Kotlin vs Scala

While working at a Scala company a few years ago, I documented a few pitfalls regarding Scala / Java interoperability. When I started looking into Kotlin I was curious to see if Kotlin had better interoperability as claimed or if it had the same issues than Scala. Most of the issues mentioned below stems from badly defined Java code, but they are all issues I have actually experienced in the wild. [Read More]
kotlin  scala  java