Type Inference
In the following lesson, you will be introduced to type inference and learn about Scala's ability to infer data types.
Type inference is Scala’s ability to infer types when not specified by the user. To better understand how this works, let’s look at the example we used in the first lesson of this chapter where we had to declare variables for the author, title, and number of pages in a book.
In the code above, we are using the following syntax:
However, Scala’s type inference feature allows us to declare a variable ...