Talk:Comparison of C Sharp and Java: Difference between revisions

Content deleted Content added
Call by reference
minor
Line 156:
== Call by reference ==
 
Note that call by reference doesn't apply just to primitive types, as it might seem at first sight. Variables in Java which are not of primitive types hold a reference to an instance, and since all method calls pass arguments by value, the reference holdheld by the variable is passed, since that is what the variable holds. But imagine you want the variable to "point" to another instance after the method returns; then you have to pass a reference to the variable itself, not the reference the variable holds.
 
A non-pragmatic but straight example in C#: