+ 3
I don't quite follow on the "By Value" and the "By reference". What happens and what is the difference exactly? :-)
3 Antworten
+ 5
"By Value" means that you operate on the "value" of the argument passed to the method. This means that whatever change you make to this argument inside the method is *not* going to affect the "original" value of the argument.
"By reference" is kind of the opposite: you don't operate on the value of the argument passed; you operate on the argument itself. This means that whatever change you make to this argument inside the method *is* going to affect the "original" value of the argument.
+ 1
By value will use only values of variables without opportunity to change them in method. By reference can do that tweak.
0
I actually just noticed that since I've posted this question I have gained more knowledgr on the topic and understand this.
I suggest that everyone, who comes across this should read the comment from Mark as he explains it simple and true :-)