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
How are commas used in the intialization and iteration parts of a for statement?
Why doesn’t the focus feature on the tag work in every circumstance?
What are the benefits of detached objects?
Define aop(assepct oriented programing)?
What is a modular application?
Can you give me a simple example of using the requiredif validator rule?
why static class in java
What’s jboss cache in short?
whats is statement and procedure
How messaging services are done, before release of JMS?
Is there a guarantee of uniqueness for entity beans?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
Explain RMI Architecture?
Why is string immutable in java?
For which statements does it make sense to use a label?