Value type and reference type seems to very small topic but it effect programming a lot. Value type are those whenever these are passed to any function then any change in value in calling function will never reflect into original source. Reference type are those whenever these are passed to any function then any change in value in calling function will reflect changes in original source. For value type datatypes you can implement reference call using ref and out keyword.
Class objects are by default reference type so making copy of them is also doing using new object and assigning value to each property individually. For passing object reference ref or out keyword is not required as class objects are by default reference type.
Difference between ref and out is:
ref keyword can be used in un-managed code as it don't give guarantee of any change or assignment of value to reference object passed. But out keyword in other place guarantee assignment or change to passed reference objects.
Note: you can not declare 2 methods with same name and having same type of parameters just making difference in key word used.
Watch video Value type and reference type objects in C#.Net online without registration, duration hours minute second in high quality. This video was added by user techsapphire 23 February 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,428 once and liked it 25 people.