What is the use of New Keyword
Answers were Sorted based on User's Feedback
Answer / ruchi shrivastav
The New keyword is used to hide the method and crete memory
allocation and also used to define object of class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Objects can be created by using the new keyword followed by the name of the class that the object will be based on, like this:-
1) Customer object1 = new Customer();
NOTE:- When an instance of a class is created, a reference to the object is passed back to the programmer. In the previous example, object1 is a reference to an object that is based on Customer.
2) Customer object3 = new Customer();
Customer object4 = object3;
NOTE:- This code creates two object references that both refer to the same object. Therefore, any changes to the object made through object3 will be reflected in subsequent uses of object4. Because objects that are based on classes are referred to by reference, classes are known as reference types.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / saran
The New keyword is used to create the object for the class, all properties are invoked
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ashok
that Allocates memory at runtime instead of compile time
| Is This Answer Correct ? | 3 Yes | 4 No |
Answer / abdul rawoof.l
whenever objects create the new keyword constructor is immediately call.
| Is This Answer Correct ? | 0 Yes | 1 No |
Describe ways of cleaning up objects in c#.
Are c# strings immutable?
What?s the difference between <c> and <code> XML documentation tag?
Explain how obfuscator works in .net
Explain the top reason to use c# language?
What is oledbconnection c#?
what is the difference between passing a value object by reference and a reference object by value?
How do you remove the objects which are not in use?Explicitly or implicitly?What is the exact mechanism going behind?
2 Answers Advanced Software Systems, Choice Solutions,
What is serializable in c#?
What?s an interface class?
What is strong name in c# and how can we use it?
What is eager loading 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)