Content deleted Content added
Line 540:
::I believe that if you dig deeply in the Java language specification, you'll find that the passing of references is implementation defined. This means that it can be implemented in whatever way the developers selected. The method you describe can be one of the candidates for sure, it's implementation defined after all. However, I can assure that in reality it's definitely working differently than you describe. Functions make a copy of the object only if they modify it. This does not fit any of the standard pass-by-value or pass-by-reference definitions, since it's a bit more complex. Thus I agree with Nigelj, that C++ and Java concepts shouldn't be treated as interchangeable. [[User:1exec1|1exec1]] ([[User talk:1exec1|talk]]) 23:06, 9 December 2010 (UTC)
:::No, functions never make a copy of the object they modify. When you pass a reference type to a method in Java, the method can change the object the reference refers to. This is just the same as in any language when two pointers point to the same object. If you think Java is doing something other than pass by value, you horribly confused. -- [[User:Schapel|Schapel]] ([[User talk:Schapel|talk]]) 23:13, 9 December 2010 (UTC)
:::You can see a visual description of what's going on when you pass references to methods [http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html here]. -- [[User:Schapel|Schapel]] ([[User talk:Schapel|talk]]) 23:18, 9 December 2010 (UTC)
== "neutrality" is counter to the point ==
|