Java 7 Type Inference: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Java =TODO= * Java 7 Type Inference for Generic Instance Creation https://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inferenc...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
* [[Java#Java_7|Java]]
* [[Java Generics Concepts|Java Generics Concepts]]
=Overview=
The type can be inferred from context with generic inference using the diamond operator (<>).
<syntaxhighlight lang='java'>
List<String> listOfStrings = new ArrayList<>();
List<Integer> listOfIntegers = new ArrayList<>();
</syntaxhighlight>


* [[Java#Java_7|Java]]
=Target Type=


=TODO=
=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
* 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 [[Java_8_Lambda_Expressions#Formal_Parameters|formal parameter list]].

Latest revision as of 00:01, 9 September 2021

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.