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 a sessionfactory? Is it a thread-safe object?
What must a class do to implement an interface?
What are externizable interface?
What’s jboss jbpm?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
Is “abc” a primitive value?
What are the different methods of identifying an object?
What are the sequence of steps to write pub or sub model kind of application?
What class is used to create Server side object ?
Can you give me a simple example of using the requiredif validator rule?
What method is invoked to cause an object to begin executing as a separate thread?
Why use POJO when I can use hashmap
What are callback interfaces?
Write a singleton program?
Explain the difference between object state and behavior?