3 ms·
Java is pass by value with mutable objects. Pass by reference is a different thing. I think Java causes this confusion because it's so restrictive about what y
by kevinpet 16y ago
Java is pass by value with mutable objects. Pass by reference is a different thing.
I think Java causes this confusion because it's so restrictive about what you can do with pointers. In C, the difference between a struct and a pointer to a struct is very clear. In Java, the fact that X x = new X() stores a pointer is sort of invisible.