Scope on methods and properties

So maybe a very basic question,
But can someone give me an ‘explain like I’m 5’ of how Xojo handles scope?
Such as private, public, and protected when using them on methods and properties.

Does public give access to the item from outside the program? Or does it just allow all parts of the program to have free access to it?

I’m used to dealing with c++/Java where I think it’s a bit more straightforward on what that means.

I couldn’t find a good explanation of how it’s handled in here though.

For classes, the scopes work the same as Java.

  • Public: everyone can see it
  • Protected: the class itself and any subclasses can see it
  • Private: only the class itself can see it

But none of them give access from outside of your program.

Ok, so a private object attached to say a window, can only be seen by that window,
but a public object could be seen by other parts of the program then right?

Right