-
Notifications
You must be signed in to change notification settings - Fork 0
Access modifiers
JonathanOrr edited this page Aug 26, 2023
·
3 revisions
public The type or member can be accessed by any other code. The accessibility level of public members of a type is controlled by the accessibility level of the type itself.
private The type or member can be accessed only by code in the same class or struct.
| Caller's location | public |
private |
|---|---|---|
| Within the class | ✔️️ | ✔️️ |
| Derived class | ✔️️ | ❌ |
| Non-derived class | ✔️️ | ❌ |
Lua is not an OO language. To simplify the logic and ensure performance, all members regardless of accessibility are inherited by default (unless the static keyword is used).