An object creation expression is used to create a new instance of a class type or a structure type. The type of an object creation expression must be a class type or a structure type and cannot be an abstract. Given an object creation expression of the form New T(A)
, where T
is a non-abstract class type or structure type and A
is an optional argument list, overload resolution is used to determine the correct constructor of T
to call. If no constructor is callable, then an error occurs, otherwise the expression results in the creation of a new instance of T
using the chosen constructor. If there are no arguments, the parenthesis may be omitted.
New
TypeName [ (
[ ArgumentList ] )
]