When we have a private variable ( or whatever it is ) the only method to call it is by using the "this" operation?
LeonThePro
Level 4
private variable
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Thomas
31 October 2024, 17:09
The access modifier has a meaning only if you look from outside the class at the class or its proprties. 'Inside' the class it is from no meaning at all. This refers to the current object (so we're inside the class' code), hence access modifier are not relevant.
Eg. you have a class Main and a class Util, then you can access only public methods/ fields/ static variables if they are public
0