Java 7 Type Inference: Difference between revisions
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
List<Integer> listOfIntegers = new ArrayList<>(); | List<Integer> listOfIntegers = new ArrayList<>(); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Target Type= | |||
=TODO= | =TODO= |
Revision as of 02:00, 24 March 2018
Internal
Overview
The type can be inferred from context with generic inference using the diamond operator (<>).
List<String> listOfStrings = new ArrayList<>();
List<Integer> listOfIntegers = new ArrayList<>();
Target Type
TODO
- Java 7 Type Inference for Generic Instance Creation https://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html
- Type inference used by lambda expression, which can omit the explicit type declaration in the formal parameter list.