Meeting 11: Unterschied zwischen den Versionen
Aus Java Student User Group Austria - Java + JVM in Wien Österreich / Vienna Austria
(kflXUhbM) |
(zVACdRmgIuxkyRzGXD) |
||
Zeile 1: | Zeile 1: | ||
− | the | + | Passes references by value, but the fact is if you bring up eiehtr you are going to confuse people.I usually use simpler terms because those two are actually useless as a summation. A two piece answer can work wonders:You can modify anything passed into a method without effecting the caller, BUTJava never creates objects on it's own, so if you pass in an object and modify that, of course it will modify the object.So Java just does what is simple and makes sense. Any other methodology would detract from overall usability. |
Version vom 14. Dezember 2012, 17:20 Uhr
Passes references by value, but the fact is if you bring up eiehtr you are going to confuse people.I usually use simpler terms because those two are actually useless as a summation. A two piece answer can work wonders:You can modify anything passed into a method without effecting the caller, BUTJava never creates objects on it's own, so if you pass in an object and modify that, of course it will modify the object.So Java just does what is simple and makes sense. Any other methodology would detract from overall usability.