Visibility Modifier

You may have seen public keyword everywhere throughout every programming program.

The public keyword is a modifier. Besides public we also have private,** protected, they all are **access modifier. There is also another type called non-access modifier(like static, final, abstract)

This section will talk about the Java modifier

  1. What is the modifier?
  2. Different kinds of modifier and their functionality.

What is a modifier?

The definition of Access and Non-access is different:

The Access modifier defines the access level for classes, attributes, methods and constructors.

Non-Access modifiers have nothing to do with the access level but provided other important functionality.


Access modifier

Access modifier

Non-Access Modifier

non-access

Reference:Java Modifiers