Re: pass by reference
Andreas Leitgeb wrote:
Chase Preuninger <chasepreuninger@xxxxxxxxx> wrote:
All objects are "passed by reference" and all primitive types have
their value copied.
The objects are indeed passed by reference.
When I took a practice certification exam in Java, I was marked wrong for
saying that objects are passed by reference. The fact is that objects are not
passed at all - references are, and they are passed by value.
--
Lew
.
Relevant Pages
- Re: How java passes object references?
... Which everybody knows, it doesn't in Java. ... The reason I think this is a useful clarification is that when you got to the part about how passing by reference might work, it seems you went off track at least partly because you didn't understand the nature of the above. ... is a pointer pointing at the memory block. ... Assignments to local variables, or even to class members, do not allocate memory. ... (comp.lang.java.programmer) - Re: The Java no pointer big fat lie!
... > reference types, it wouldn't be a good comparison. ... and what you can't - and there is a big difference in Java to C and C++. ... You cannot change it in the language itself, ... Thus I would distinguish pointers from ... (comp.lang.java.programmer) - Re: call by reference
... We started learning Java about one month ago, and they just don't believe me when i try to explain that there is a confusion when passing reference types as an argumetn to a function. ... The actual parameter must be an L-value. ... (comp.lang.java.programmer) - Re: programming concepts > specific languages
... >actually changes the target of the reference passed to 'function2'. ... Java from a source that was not precise about terminology. ... if I have a class MyObject and write ... I thought primitive types in particular behave in the ... (comp.programming) - Re: no pointer in Java => my problem
... Does Java pass objects by reference or by value? ... f could also modify the StringBuffer by appending " World" for instance. ... (comp.lang.java.programmer) |
|