Understanding types

The type of something is a summation of the information the compiler owns about this something. In the most general case, we're talking about the type of a variable; the knowledge of the compiler includes the methods that are available on this variable and the classes that the variable extends. A very convenient feature of Scala is that it tries to use type inference where possible, freeing the developer from the need to define types explicitly.

Let's take a structured look at Scala's type system, starting with a short recap of its basics.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.212.212