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 difference between passing a value object by
reference and a reference object by value?

Answer Posted / ashish diwakar

Value Objects are the objects that contain the data as
objects such int, string, etc...
Reference Objects are the objects that contain the data as
reference such as StringBuilder,etc...

When a Value object is passed as reference the reference of
the object is passed to the method (which means that any
change made to variable will be reflected on the original
variable).
But when a Reference Object is passed by value Like :
StringBuilder sb =new StringBuilder();

sb.Append("hello");

Display(sb);

any change made on sb inside Display function will not
change value of sb.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is main function of alternate teamplate of datalist?

2237


What are the basics of c#?

972


What is arraylist c#?

873


Explain the three test cases in unit testing?

959


What is double c#?

881


Can we make a Static Constructor Parameterized? Give Reason with your answer

922


What are nested classes in c#?

905


What is marshalling in c#?

817


How do I simulate optional parameters to com calls?

902


Is c# code is unmanaged or managed code?

1059


Do extension methods have to be static?

951


Why extension method is static?

854


In .NET which is the smallest unit of execution?

1012


What is cookies c#?

843


What is string interpolation in c#?

916