As we know Kotlin and Java are inter-operable. When I try to access Java static variable inside Kotlin code it works, but when I try to access companion object in Java, it does not work.
Advertisement
Answer
you just need to add JvmStatic annotation
companion object{ @JvmStatic val x=10 }