How to access Object class from Kotlin in Java

Viewed 33

I am new to Kotlin. I have a kotlin Object class like

@Parcelize
object AddCard

I want to access it in a Java class. if I have to do so I read that i have to give @JVMStatic annotation to the object class.something like

@JVMStatic
@Parcelize
object AddCard 

when I add the annotation it says

This annotation is not applicable to target object.

How to handle this?

1 Answers

You don't have to do anything special. You can access it from Java with just AddCard.INSTANCE.

Related