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 / priya

If you want to pass the value of the variable, use the
ByVal syntax. By passing the value of the variable instead
of a reference to the variable, any changes to the variable
made by code in the subroutine or function will not be
passed back to the main code. This is the default passing
mechanism when you don’t decorate the parameters by using
ByVal or ByRef.

If you want to change the value of the variable in the
subroutine or function and pass the revised value back to
the main code, use the ByRef syntax. This passes the
reference to the variable and allows its value to be
changed and passed back to the main code.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a concrete class in c#?

1035


Why we use get set property in c#?

989


Why do we use void in c#?

921


What is the difference between “constant” and “readonly” variables in c#?

1065


What is the difference between early binding and late binding in c#?

1008


Can you pass parameters to destructors?

1114


Why is static constructor called first?

949


Explain About Virtual functions and their use.

1076


Is a dll an assembly?

957


What is string concatenation?

1052


What is the difference between “dispose” and “finalize” variables in c#?

1067


What is escape sequence in c#?

1064


Explain the difference between the system.array.copyto() and system.array.clone()?

975


What is difference between code access and role based security?

1158


What is the diff between the System.Array.CopyTo() and System.Array.Clone()?

1049