C Sharp (C#) - Classes and Objects
In C#, what is the primary effect of using
new when you write var obj = new SampleClass();?new when you write var obj = new SampleClass();?new keywordnew keyword in C# is used to create an instance of a class.new SampleClass() is executed, it allocates memory for the object and calls the constructor to initialize it.new creates and initializes an object. [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions