posted 17 years ago
I am not sure what you mean. Everything is pass by value, not reference.
If the calling method only needs an int from another object, why not pass just that? It is not like any manipulations of the value outside the object that returned the int can affect the int inside the object. If you need the whole object, then go ahead. Perhaps I am misunderstanding you, but IMO, it comes down to the specific situation, like most things.
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra