I\'ve just read: http://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/
As far as I understand, Null
is a trait and its only instance is
I've never actually used the Null
type, but you use Unit
, where you would on java use void
. Nothing
is a special type, because as Nathan already mentioned, there can be no instance of Nothing
. Nothing
is a so called bottom-type, which means, that it is a sub-type of any other type. This (and the contravariant type parameter) is why you can prepend any value to Nil
- which is a List[Nothing]
- and the list will then be of this elements type. None
also if of type Option[Nothing]
. Every attempt to access the values inside such a container will throw an exception, because that it the only valid way to return from a method of type Nothing
.