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
What is sql transaction in c#?
How long does it take to learn c# programming?
Explain the security with aop?
Why is ienumerable used?
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
What is interface inheritance in c#?
In .NET which is the smallest unit of execution?
What is Wrapper class in dot net?
Is c# and .net same?
What is function and method in c#?
Is c# good for web development?
How do I link two windows forms in c#?
What is c# in asp net?
Describe two uses of the “using” statement during the operation of c#?
Is a char?