Can you mix Kotlin with Java?

Even if it’s interop you can’t mix Java and Kotlin in the same file . If you really want to have static methods/variables you can use an companion object . You can also access create a “real” static method in your JVM by using @JvmStatic . By using @JvmStatic you can use Java to access your Static methods like before.

Sizin İçin Seçtik  Axie Infinity nasıl başlanır?

Leave a Reply

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

Can you mix Kotlin with Java?

Even if it’s interop you can’t mix Java and Kotlin in the same file . If you really want to have static methods/variables you can use an companion object . You can also access create a “real” static method in your JVM by using @JvmStatic . By using @JvmStatic you can use Java to access your Static methods like before.

Sizin İçin Seçtik  Does Kotlin replace Java?

Leave a Reply

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