What is the 'new' keyword used for in C#?
Experience Level: Junior
Tags: C#
Answer
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.
new
keyword 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.
Related C# job interview questions
What is a 'var' keyword in C# good for?
C# JuniorWhat is a variable?
C# JuniorHow can you assign a value to a property in C#?
C# JuniorHow can you recognize a property in C#?
C# JuniorWhat is a property in C#?
C# Junior
Chat
Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.
Anonymous
Καλησπέρα.
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
the infinteis -3/15 so 1triition / infinet
Anonymous
e
e
Anonymous
<a href="https://inspirum.pl "
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
[url]https://inspirum.pl[/url]
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e