Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A New expression is used to instantiate an object of a specific class.
-
new-expression = "New" type-expression
Static semantics. A New expression is invalid if the type referenced by <type-expression> is not instantiable.
A New expression is classified as a value and its declared type is the type referenced by <type-expression>.
Runtime semantics. Evaluation of a New expression instantiates a new object of the type referenced by <type-expression> and returns that object.