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

Does Java pass arguments by value or reference?

Answer Posted / mr.h

In Java no matter what type of argument you
pass the corresponding parameter (primitive variable or object reference) will get a copy of that data, which is
exactly how pass-by-value (i.e. copy-by-value) work.

In Java, if a calling method passes a reference of an object as an argument to the called method then the passedin
reference gets copied first and then passed to the called method. Both the original reference that was
passed-in and the copied reference will be pointing to the same object. So no matter which reference you use, you
will be always modifying the same original object, which is how the pass-by-reference works as well

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 permgen or permanent generation?

973


What are the sequence of steps to write pub or sub model kind of application?

2471


What is a modular application?

1020


What is meant by method chaining?

1100


Why are component architectures useful?

1019


What is Stream Tokenizer?

2186


how do you Handle Front End Application data against DB with example?

1929


What is chat area? Explain.

972


how to use debug in my elipse to solve problems that exist in my project

2234


Difference between DurableSubscription and non- DurableSubscription?

2142


what is handle?

2324


What is the purpose of the wait() method?

1120


What is message driven beam?

1013


How are commas used in the intialization and iteration parts of a for statement?

1056


Why use a datasource when you can directly specify a connection details?

980