Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/zopsoycb/androidpe.com/wp-includes/functions.php on line 6114
JVM annotations commonly used in Kotlin for Android development - AndroidPe

JVM annotations: Java interoperability is one of the advantages of Kotlin. It helped easier transitions to Kotlin while keeping part of your code in Java. There are cases where you would need annotations to tell Kotlin compiler on how the method or field should be used by a Java class.

JVM annotations

Here are some of the commonly used JVM annotations in Kotlin while developing an Android app:

  1. @JvmStatic
  2. @JvmField
  3. @JvmOverloads
  4. @JvmName

Your own libraries, modules or 3rd party code written in Java can smoothly access your Kotlin code with the help of above annotations.



By Vivek

Leave a Reply

Your email address will not be published. Required fields are marked *