Use of @jvmstatic, @jvmfeild in above code

After writing @jvmFeild above data members and @jvmStatic above member function,what changes did we encounter in our project,means after using them what happened to our code and how it became optimized???

Both of these annotations are helpful when interacting with java code if your project is pure kotlin they don’t help you with anything.

if we will not use these notations what will happen,i want to understand their specific use???

If you use jvmfield it won’t generate getters and setters and for jvmstatic enables you to use static fields in java too otherwise you would get compilation error.

1 Like