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
How do I simulate optional parameters to com calls?
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?
What is a reference type c#?
Define constructors
What is append in c#?
What is the difference between string and stringbuilder in c#?
How can we sort an array in c#?
What is Wrapper class in dot net?
Where is c# compiler located?
How do I register my code for use by classic com clients?
Explain hash table in c# ?
What's c# ?
What is the default value of object in c#?
what is boxing and unboxing?can we initialize unboxing directly?
Is as keyword in c#?