Calling companion object from Java


#1

How do I call a companion object from java, eg.

class Foo {
companion object Goo {
fun boo()
}
}

I want to do Foo.Goo.boo() in Java.

Intellij finds the Companion field on the class but then refuses to compile it.


#2

Actually never mind, I was trying to call this from Scala, which doesn’t work, and not Java as I was originally thinking (brain freeze).