15.9. Class Instance Creation Expressions

A class instance creation expression is used to create new objects that are instances of classes.

ClassInstanceCreationExpression:    new TypeArgumentsopt TypeDeclSpecifier TypeArgumentsOrDiamondopt                                                           ( ArgumentListopt ) ClassBodyopt    Primary . new TypeArgumentsopt Identifier TypeArgumentsOrDiamondopt                                                           ( ArgumentListopt ) ClassBodyoptTypeArgumentsOrDiamond:    TypeArguments    <>ArgumentList:    Expression    ArgumentList , Expression

A class instance creation expression specifies a class to be instantiated, possibly followed by type arguments (§4.5.1) or a diamond (“<>”) if the class being ...

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.