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


Please Help Members By Posting Answers For Below Questions

What is the implicit name of the parameter that gets passed into the set method/property of a class?

726


Difference between Value type & reference types ? and give the example in .Net?

721


4. Describe the process when we send a request URL? And who is responsible for that?

1736


Explain how can you clean up objects holding resources from within the code?

698


What are the differences between events and delegates in c#?

687


Explain the differences between static, void and public in c#?

752


What is the difference between readkey and readline in c#?

673


What is a datacontract?

671


What is the difference between static class and sealed class in c#?

693


Why do we need encapsulation in c#?

732


Is list a collection c#?

736


Is and as keyword in c# net?

749


When can a derived class override a base class member?

697


What is difference between dynamic and var in c#?

688


Which string method is used for concatenation of two strings in c#?

704