Java has only pass by value associated with it. Even when an Object is passed the value of Object reference in the Stack is passed(not the actual Object in Heap) But since the value passed in is a reference to an Object any modification to the data in this Object will modify the data in original Object. But any assignment operation done to the passed value will not affect the orignal object.
Category:Java Interview Questions
No comments:
Post a Comment