04-20-2008, 09:11 PM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Apr 2008
Posts: 12
Thanks: 7
|
Quote:
Originally Posted by freenity
the return is used for reading, you asked about changing it's value?
Well, you can't 'lock' a variable to read only inside a class.
It is supposed that a class is a totally separate entity and you are the one who read/write class's properties unless you don't trust yourself :)
|
Well i do trust myself, but i just see it as a better solution to be able to 'lock' a variable so only the class and not the instance can give the variable a value.
It would decrease the use of return in a class and you would not need to assign a new variable outside the class to hold the value.
|
|
|
|