Java is pass by value or pass by reference


Java is neither pass by value nor pass by reference.Actually java is pass by value of variable i.e. reference variable.
So Java is pass-by-copy-of the-variable! 

For example, if you pass an int variable with the value of 9, you're passing a copy of the bits representing 9. The called method then gets its own copy of the value.


Popular posts from this blog

Conversion from Clob To String in java and Vice versa

Portable Java 8/ JDK8 setup without admin rights

Multi Threading , Producer consumer problem in Java