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 execution entry point for a c# console application?

773


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

713


Where is the main method in c#?

768


Can a constructor be private in c#?

705


What is the difference between an application domain and a process?

717


What is default constructor in c#?

705


What is the use of nullable types in c#?

730


What exactly is serverless?

632


Why dataset is used in c#?

750


What is concrete method in c#?

720


What is Web.config?

776


Can you have more than one namespace in c#?

712


Is c# code is unmanaged or managed code?

812


What is private variable?

699


what is the difference between a struct and a class in c#?

831