icon-cookie
The website uses cookies to optimize your user experience. Using this website grants us the permission to collect certain information essential to the provision of our services to you, but you may change the cookie settings within your browser any time you wish. Learn more
I agree
Summary | 6 Annotations
@file:JvmName("Utils") @file:JvmMultifileClass
2017/09/21 09:43
If you need to expose a Kotlin property as a field in Java, you need to annotate it with the @JvmField annotation.
2017/09/21 09:43
You can annotate a property with @JvmField if it has a backing field, is not private, does not have open, override or const modifiers, and is not a delegated property.
2017/09/21 09:43
Usually these fields are private but they can be exposed in one of the following ways: @JvmField annotation; lateinit modifier; const modifier.
2017/09/21 09:43
Kotlin can also generate static methods for functions defined in named objects or companion objects if you annotate those functions as @JvmStatic
2017/09/21 09:44
If you use this annotation, the compiler will generate both a static method in the enclosing class of the object and an instance method in the object itself
2017/09/21 09:45