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 to determine SGA site?
What is the relationship between an event-listener interface and an event-adapter class?
what is a non-repeatable read?
Is a class a subclass of itself?
What is in-memory replication?
Is there a guarantee of uniqueness for entity beans?
What is the purpose of the finally clause of a try-catch-finally statement?
What is the difference between java class and bean?
When a thread blocks on i/o?
Why is string immutable in java?
Explain the advantages and disadvantages of detached objects.
What is TL and its use?
How database connectivity in XML is achieved?
Name the eight primitive java types.
What is threadfactory?