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
What is the implicit name of the parameter that gets passed into the set method/property of a class?
Difference between Value type & reference types ? and give the example in .Net?
4. Describe the process when we send a request URL? And who is responsible for that?
Explain how can you clean up objects holding resources from within the code?
What are the differences between events and delegates in c#?
Explain the differences between static, void and public in c#?
What is the difference between readkey and readline in c#?
What is a datacontract?
What is the difference between static class and sealed class in c#?
Why do we need encapsulation in c#?
Is list a collection c#?
Is and as keyword in c# net?
When can a derived class override a base class member?
What is difference between dynamic and var in c#?
Which string method is used for concatenation of two strings in c#?