Referencing Scala object from Java

I keep forgetting this very simple code to reference a Scala object from Java code. I have no problem remembering much more complex constructions, that involve generics and type boundaries, but for some reason this one little piece keeps eluding me. If you are like me, here is that line:

object Test {
  def doSomething() = ???
}

And now in Java:

Test$.MODULE$.doSomething();

Now I should remember.

Posted On

Category:

Tags: / /