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 abstract schema?
How to pass parameters in RMI?
What is threadfactory?
If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?
What is TL and its use?
Is the session factory thread safe?
What is the difference between RMI registry and OS Agent?
Explain about thread synchronization inside a monitor?
Difference between swing and awt?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Why is string immutable in java?
What is local interface. How values will be passed?
What are the steps to write p-to-p model application?
What is the difference between session and entity beans?
What are the benefits of detached objects?