alexvd:
If I get the picture right, you have protected or private property of class, which value you would like to access from outside of the class.
Why don't you make a public method which will return value of property?
Yes, of course it's possible, but giving it this behaviour with a special keyword wouldn't have required another method.If I get the picture right, you have protected or private property of class, which value you would like to access from outside of the class.
Why don't you make a public method which will return value of property?
TheEconomist:
Yes, of course it's possible, but giving it this behaviour with a special keyword wouldn't have required another method.
Yes, of course it's possible, but giving it this behaviour with a special keyword wouldn't have required another method.
Did you mean SET/GET?
We are thinking about it, but decision has not been made yet.
The point was to be readonly only from outside of the class , but to be completely writeable from the class as well from its heir classes.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Well, I don't mean readonly in the meaning that it has in other programming languages, when you design classes visually.
But I find a bit frustrating that I can't print for instance a protected property from outside of a class. That's why I'd like also a readonly type, which is accessible from any point of the code, like a public, but it is constrained to be readonly, only for output purposes.
What do you think about this?