Pointers and references: Difference between revisions

Content deleted Content added
→‎{{header|Java}}: The second half didn't make sense and semicolons aren't that cool
Line 232:
}
 
Java's is always call-by-value; hence,with primitives and call-by-reference with objects. So it is not possible to change the value of thea primitive variable of the caller that is passed in, whether it is a primitive or a reference. However, asAs noted above, if the object that the reference is pointing to is mutable, then it is possible to modify that object's state through the reference;, andor change the reference altogether. Then if the calling function has a reference to the same object, they will see that modification through the reference. So if you want to reflect changes in an argument back to the caller, one thing that you can do is wrap the argument as a field in an object;, then modify the object through the reference.
 
=={{header|Perl}}==