https://kotlinlang.org logo
Title
m

Mark

11/22/2019, 5:02 AM
When converting an old java Utils-style class (never instantiated, only containing statics) to Kotlin, do you typically: 1. remove the Utils class completely, and move those methods up to file-level (converting to use extension functions where possible/appropriate) 2. convert the Utils class to use
object
modifier 3. keep the Utils class and put the methods in a
companion object
2️⃣ 5
1️⃣ 11
v

varun

11/22/2019, 6:22 AM
I follow the first step and then put a
@file:JvmName('...')
at the top of the Kotlin file so that the Java code accessing those methods don't change at all.
👆 2
👍 5