• +91 9723535972
  • info@interviewmaterial.com

Kotlin Interview Questions and Answers

Question - What is the use of @JvmStatic, @JvmOverloads, and @JvmFiled in Kotlin?

Answer -

Following are the main usage of @JvmStatic, @JvmOverloads, and @JvmFiled in Kotlin:

  1. @JvmStatic: The @JvmStatic annotation is used to tell the compiler that the method is a static method, and you can use it in Java code.
  2. @JvmOverloads: The @JvmOverloads annotation is required when we need to use the default values passed as an argument in Kotlin code from the Java code.
  3. @JvmField: The @JvmField annotation is used to access the fields of a Kotlin class from Java code without any getters and setters. We need to use the @JvmField in the Kotlin code.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners