Why's type lattice in Scala?

1.2k Views Asked by At

I heard someone said:

"Scala uses a type lattice rather than a type hierarchy, which is different from Java".

I do not quite understand what the meaning type lattice is and what the main difference between type lattice and type hierarchy is.

Could someone explain this term to me?

1

There are 1 best solutions below

3
On BEST ANSWER

Its essentially means that : The type hierarchy for Scala is a lattice, i.e. it has a “bottom” as well as a “top”.

enter image description here

As seen from the image the top type here is Any and the bottom is Nothing.