Type Inference

This lesson explains the concept of type inference.

We'll cover the following...

Question # 1

What is type inference?

Type inference is Java compiler's ability to look at each method invocation and corresponding method declaration to determine the type argument, or arguments that make the invocation applicable. The inference algorithm determines the types of the arguments and, if available, the type of the result being assigned, or returned. Consider the useless but instructional class below: ...