Employee emp1;
Employee emp2 = new Employee();
emp1 = emp2;
In above example emp2 has an object instance of Employee Class. we can see that emp1 object is set as emp2. this means that the object emp2 is referred in emp1, rather than copying emp2 instance into emp1. When we make a change in emp2 object, corresponding changes can be seen in emp1 object.
Liked By
Write Answer
What is Reference Type in C# ?
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
20-Apr-2018lets take an example to understand
In above example emp2 has an object instance of Employee Class. we can see that emp1 object is set as emp2. this means that the object emp2 is referred in emp1, rather than copying emp2 instance into emp1. When we make a change in emp2 object, corresponding changes can be seen in emp1 object.