https://kotlinlang.org logo
Title
m

menegatti

06/13/2017, 10:56 AM
anotate the method inside a companion object with
@JvmField
r

radityagumay

06/13/2017, 12:29 PM
menegatti: this is not always true, unless you call a getter from java.
k

kingsley

06/13/2017, 6:55 PM
@menegatti you mean
@JvmStatic
s

sdeleuze

06/14/2017, 7:29 AM
m

menegatti

06/14/2017, 7:59 AM
@kingsley if it's inside a companion object, @JvmField makes it static... That's how you implement the Parcelable interface in Android, for instance
👏 1
👍 1
:kotlin: 1
k

kingsley

06/14/2017, 9:57 AM
Oh. Yes.
@JvmField
for fields.
@JvmStatic
for methods. Your text was about methods. Hence my comment 🙂
m

menegatti

06/14/2017, 10:00 AM
Oh yeah, that makes sense
👍 1
you're absolutely right