anotate the method inside a companion object with ...
# announcements
m
anotate the method inside a companion object with
@JvmField
r
menegatti: this is not always true, unless you call a getter from java.
k
@menegatti you mean
@JvmStatic
s
m
@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
K 1
👍 1
k
Oh. Yes.
@JvmField
for fields.
@JvmStatic
for methods. Your text was about methods. Hence my comment 🙂
m
Oh yeah, that makes sense
👍 1
you're absolutely right