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


Please Help Members By Posting Answers For Below Questions

If your ui seems to freeze periodically, what might be a likely reason?

551


Why doesn’t the focus feature on the tag work in every circumstance?

573


what are RemoteObjects?

2262


What is Remote Server?

1688


What is table mutation and how do you avoid it?

1920






Are there books about seam?

637


What are the benefits of detached objects?

588


What is the difference between a menuitem and a checkboxmenuitem?

590


What value does read() return when it has reached the end of a file?

556


Write a singleton program?

576


which book is better for jdbc ,servlets and jsp

1650


What restrictions are placed on the location of a package statement within a source code file?

622


Why won’t the jvm terminate when I close all the application windows?

756


Can we sent objects using Sockets?

653


how i secure my site with the https protocol.what are the steps?

1740