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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.