What is the 'new' keyword used for in C#?
Experience Level: Junior
In C# the
new keyword is used to create a new instance of a class. We are also saying the
new keyword is used to construct an object.
newkeyword followed by a class name, open and close bracket and a semicolon to your source code. In the following example, the code
new Car();does the magic.