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...

Difference between ByVal and ByRef?

Answer Posted / ashwini

When arguments are passed to a method ByVal i.e. By Value
then the original value of a variable is not passed but its
copy is created and that copy is passed. So whatever
changes are made, they will affect the copy but not the
original value of a variable.
When arguments are passed ByRef i.e. By Reference
then the argument's memory location is passed to a method.
So changes made to that argument's value will actually
affect the original value.

Is This Answer Correct ?    31 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of variables are there in c#?

908


What is overriding in c#?

832


What are the steps to create an assembly and add it to the gac?

822


Why do we need indexers in c#?

853


What are the variables in c#?

883


What is a function c#?

906


What is Reflection in .NET? Namespace? How will you load an assembly which is not referenced by current assembly?

918


Is as keyword in c#?

811


What is difference between write and writeline?

839


What is delegates in c# and uses of delegates?

787


Explain static class members.

990


Why do we need indexer in c#?

950


Define c# i/o classes?

873


What's the c# syntax to catch any possible exception?

954


Why do we use delegates?

795