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 method overloading in c#?

1042


What is garbage collection? How to force garbage collector to run?

890


How does split work in c#?

888


When should I throw an exception?

994


What is the name of c# compiler?

1138


What are the types of parameters in c#?

973


Explain why do I get an error (cs1006) when trying to declare a method without specifying a return type?

823


List out the differences between array and arraylist in c#?

971


explain the three services model commonly know as a three-tier application.

982


What does addressof operator do in background ?

1003


Why do we use abstract class in c#?

981


what is .NET framework architecture ??

2002


Which is more efficient for loop or while loop?

868


What is the diff between System.String and System.Text.StringBuilder classes?

1000


What is toint32 c#?

1036