Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of New Keyword

Answer Posted / ctharam

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I simulate optional parameters to com calls?

1000


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

976


What is a reference type c#?

1000


Define constructors

1009


What is append in c#?

921


What is the difference between string and stringbuilder in c#?

1030


How can we sort an array in c#?

964


What is Wrapper class in dot net?

1116


Where is c# compiler located?

965


How do I register my code for use by classic com clients?

933


Explain hash table in c# ?

1121


What's c# ?

1029


What is the default value of object in c#?

970


what is boxing and unboxing?can we initialize unboxing directly?

943


Is as keyword in c#?

936