Java8 Nuggets - Type Inference30 Sep 2017
This is part II, in the series of “Java8 Nuggets” articles, that explicate how to introduce Java8 features in the codebase. This is mainly for me in case I need a quick reference in the future. So they are collected as listings from my personal notes taken from reading Oracle Java release blog.
Improved Type Inference
There are some nice syntactic improvements to Type Inference in Java 8.
Use target typing to infer types for method call arguments. This will come in handy in code that uses generics.
Target Typing - Target type of an expression is a data type the compiler expects depending on where the expression appears.
can be used with Lambda
- Target Type Inference
1 code above is copyright of Oracle.