What is the use of New Keyword
Answers were Sorted based on User's Feedback
Answer / rajesh - headstrong
New is not used just to create objects of a class. It is
also used for Shadowing a method in .NET, which means if
Base class and Derived class have methods with same name
and signature, You can precede the derived class method
name with "new" keyword which makes the method a new one
altogether. This is used in retaining old implementation of
a method and you also want to introduce new implementation
for same method in your assembly
| Is This Answer Correct ? | 39 Yes | 3 No |
The keyword New is used to create the object for the
classes.using that object all the methods and properties
are invoked.
| Is This Answer Correct ? | 30 Yes | 1 No |
Answer / kalidoss
Allocate or create dynamic memory to an object during the
run time not compile time.
| Is This Answer Correct ? | 11 Yes | 1 No |
Answer / sangita patra
the new keyword is basically used in reference types to
create a object and allocate memory to it.and it can also
be used in value types to invoke the default constructor.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / deepak bankar
The new keyword is used to an object of a class.And also it
is used to hide Methods and variables
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sudhanshu shekhar
The new keyword when applied to a derived
Type,method,property,event,constant or field indicates that
the member has no relationship to a similar member that may
exist in base class.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sanjay maurya
the new keyword is basically used in reference types to
create a object and allocate memory to it.
an oter use of new keyword method overriding it override
the base class method from dirved class method when base
class method not define as vertual
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / hafiz usman majeed
as modern programming languages use this keyword
extesively, it used to assign an object the memory on heap.
and thus physically implements the class for that
particular object.
| Is This Answer Correct ? | 4 Yes | 4 No |
What is entity framework c#?
From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class?
What are the Types of caching
How to find the current application file path while runtime?
What is the difference between ref and out parameters in c#?
What do you mean by stack and heap in c#?
Can we set image Source dynamically using C# in WPF application?
Can dictionary have duplicate keys c#?
What are the different types of classes?
What is a static in c#?
What does do in c#?
What is difference between an reference type and value type in C#?
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)