How to use scala.None from Java code

Viewed 14003

Possible Duplicate:
Accessing scala.None from Java

In Java you can create an instance of Some using the constructor, i.e. new Some(value), but None has no partner class. How do you pass None to a Scala function from Java?

5 Answers

I think this ugly bit will work: scala.None$.MODULE$

There is no need for a new instance since one None is as good as another...

You can access the singleton None instance from java using:

scala.None$.MODULE$
Related