By now, you are quite familiar with the public
keyword that appears in almost all of our examples:
public class Main
The public
keyword is an access modifier, meaning that it is used to set the access level for classes, attributes, methods and constructors.
We divide modifiers into two groups:
- Access Modifiers - controls the access level
- Non-Access Modifiers - do not control access level, but provides other functionality
Practice Excercise Practice now