what is the purpose of new keyword while creating an object?
Answers were Sorted based on User's Feedback
Answer / vasantha
new keyword is used the memory is allocated at runtime for
object
| Is This Answer Correct ? | 19 Yes | 2 No |
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 |
Answer / mahendra
creating object memory and non static variable memory with default
| Is This Answer Correct ? | 0 Yes | 0 No |
What is Implementation inheritance and interface inheritance?
Does hashset allow duplicates c#?
What is better C# or VB.NET?
What is mvc in c#?
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
Can we have a non static member function in a base class to be override in derived with static modifier?
What is a struct in C#?
How do you secure a webservice?
What is parallel foreach in c#?
Why we use anonymous methods in c#?
What are the properties of a string class?
Define thread? Explain about multithreading?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)