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.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy