• Post Reply Bookmark Topic Watch Topic
  • New Topic

pass by reference  RSS feed

 
Dattatraya Baravkar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi....
Ranchian...
Please tell me how the object is passed to the method?
Is it pass by reference or pass by value?
In K.M. he had given that the object passed to method is pass by value but it works as the pass by reference?
What is right?
I'm confused abt it.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way in Java to pass an object to a method. All you can pass to a method is a reference to an object. And that reference is passed by value.
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!