Thursday, June 23, 2016

Java ALWAYS passes by value (and it is ALWAYS an interesting discussion)

Always good as a refresher.

So, when calling a method
  • For primitive arguments (intlong, etc.), the pass by value is the actual value of the primitive (for example, 3).
  • For objects, the pass by value is the value of the reference to the object.

No comments: