Thursday, 18 June 2015

Java is pass by value and pass by reference. ? 

In Java, Objects are passed by reference, and primitives are passed by value. This is half incorrect. Everyone can easily agree that primitives are passed by value; there's no such thing in Java as a pointer/reference to a primitive. 


However, Objects are not passed by reference. A correct statement would be Object references are passed by value. 

No comments:

Post a Comment