Visibility and Access¶
In marcel, there are 4 kinds of visibility.
public-> which refers to Java's public visibility. Your class/method/field may be accessible from any packageprotected-> which refers to Java's protected visibility. Your class/method/field may only be accessible from other classes in the same package or inheriting your classinternal-> which refers to Java's package-private visibility. Your class/method/field may only be accessible from classes in the same packageprivate-> Your method may be accessible only from the class it was defined in
The default visibility is public (meaning that when it isn't specified, the class/method/field will be considered as public)
Access¶
Class/method/fields access should be specified in the below order.
- public/protected/internal/private (or nothing, which would default to public visibility)
- static (Optional. only if you want your member to be static)
- final (Optional. only if you want your member to be final)