In Scala, is there any difference at all between Nil and List()?
Nil
List()
If not, which one is more idiomatic Scala style? Both for creating new emp
As user unknown's answer shows, they are the same object.
Idiomatically Nil should be preferred because it is nice and short. There's an exception though: if an explicit type is needed for whatever reason I think
List[Foo]()
is nicer than
Nil : List[Foo]