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

Explain pass by reference and pass by value?

Answer Posted / mohammad faisal

In java when we declares a variable, at runtime it
initialize and allocated a memory space.
Change in the value of variable result in the change of
output.
Now,
In pass by value,
when a value is passed, the function creates its own
variable and assign it the passed value.
So any change made by that function will not change the
value of actual variable which is passed.

In pass by refernce,
instead of passing the value we pass the address of the
variable. In this case, the function does not allocate any
memory to its variable but the variable just point to the
passed variable. Any change made by the function result in
change the value of actual variable.

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is null object in java?

1013


What is methodological theory?

996


What do bitwise operators do?

1013


What do you mean by chromounits in java8?

957


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

1161


What is thread safe java?

918


Define Multiprogramming and Multiprocessing in java.

1148


Is age a discrete variable?

977


What does method mean?

1066


Can singleton class be serialized?

950


Is java an open source?

971


What is procedure writing?

975


What is difference between equal and == in java?

959


Is it possible to use string in the switch case?

1043


Can we write a class without main method in java?

957