Voting: Unterschied zwischen den Versionen

Aus Java Student User Group Austria - Java + JVM in Wien Österreich / Vienna Austria
Wechseln zu: Navigation, Suche
(UpNyykZcUOOeJrJonc)
(nQMTafVvKryzVNipocE)
Zeile 1: Zeile 1:
You write so honestly about this. Thanks for sahirng!
+
These debates are a pet peeve of mine. IMO,  pass by value/reference  is C/C++ temlonirogy that's clearly confusing when applied directly, with the same exact meaning, to Java.  Reference  means something different in Java, and Java has no concept of C/C++'s pass by reference feature, so there's not much value in dragging it into any explanations.I think it's perfectly fine to say that objects in Java are  passed by reference.  We mean the Java definition of  reference,  not the C/C++ definition. If you're trying to explain Java to a new developer,  pass by reference  will make a lot more sense to them.

Version vom 14. Dezember 2012, 17:21 Uhr

These debates are a pet peeve of mine. IMO, pass by value/reference is C/C++ temlonirogy that's clearly confusing when applied directly, with the same exact meaning, to Java. Reference means something different in Java, and Java has no concept of C/C++'s pass by reference feature, so there's not much value in dragging it into any explanations.I think it's perfectly fine to say that objects in Java are passed by reference. We mean the Java definition of reference, not the C/C++ definition. If you're trying to explain Java to a new developer, pass by reference will make a lot more sense to them.