Does Java pass arguments by value or reference?
Answer Posted / prs01
Pass by value.
1. When passing primitives, it passes a copy of the
variable to the method. Any change made in the method does
not reflect in the calling method.
2. When dealing with objects, a copy of their
reference/address is passed. Thus the change made to the
object is reflected in the calling method.
| Is This Answer Correct ? | 22 Yes | 4 No |
Post New Answer View All Answers
What is ripple effect?
What is a modular application? What does module-relative mean?
What are the types of scaling?
What is the difference between the ‘font’ and ‘fontmetrics’ class?
What is synchronization and why is it important?
What is prototype?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
Why does the tag url-encode javascript and mailto links?
What are the different approaches to represent an inheritance hierarchy?
the same information whether it will connect to the database or it will be used previous information?
What is the infobus?
Do I have to use jsps with my application?
Why doesn’t the focus feature on the tag work in every circumstance?
Can I use javascript to submit a form?
Why does the option tag render selected=selected instead of just selected?