Possibility to call a Java static method in Kotlin

interop, java, kotlin, methods, static

Solution

Yes, you can. Java code:

public class MyJavaClass {
    public static void printFoo() {
        System.out.println("foo");
    }
}

Kotlin code:

fun main(args: Array<String>) {
    MyJavaClass.printFoo()
}

So easy =)

Problem

Suppose we have a Java static method: ``` //Java code public static void printFoo() { System.out.println("foo"); } ``` It is possible to call that method in Kotlin?

Original source

Related problems