Java syntax: Difference between revisions

Content deleted Content added
m Abstract classes: formatting
Line 1,422:
</source>
 
When a variable of a parametrizedparameterized type is declared or an instance is created, its type is written exactly in the same format as in the class header, except the actual type is written in the place of the type variable declaration.
 
<syntaxhighlight lang=Java5>
Line 1,430:
</syntaxhighlight>
 
Since Java SE 7, it is possible to use a diamond (<code><></code>) in place of type arguments, in which case the latter will be inferred. The following code in Java SE 7 is equivalent to the code in the previous example:
 
<syntaxhighlight lang=Java5>