what is the purpose of new keyword while creating an object?
Answer Posted / noor mohammad
Types cannot be used without being instantiated. To
instantiate a type, you use the new operator, which invokes
the logic specified in the constructor. After completion,
the constructor returns a new instance of the specified
type—this instance can now store data as your C# program
executes.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Can fields inside a class be virtual?
How do I create a .exe file?
What is difference between constants and read-only?
What happens if a static constructor throws an exception?
What is meant by enumerable in c#?
if a method is marked as protected internal who can access it?
What is namespace give the example?
Which config file has all the supported channels/protocol?
How does dependency injection work c#?
What is the main purpose of linq?
What is namespace explain with example?
What is difference between internal and protected internal in c#?
How do you serialize in c#?
Can constructor be protected in c#?
What is difference between static and constant variable?