Java 7 Type Inference

From NovaOrdis Knowledge Base
Revision as of 00:01, 9 September 2021 by Ovidiu (talk | contribs) (→‎Internal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

  • Type inference used by lambda expression, which can omit the explicit type declaration in the formal parameter list.