protected Keyword
Using a protected
keyword declares protected visibility for a class, variable, or method. Items with protected visibility can be accessed by any subclasses of the class in which the protected item is declared, but cannot be accessed from other classes in the program.
Here’s an example that declares a protected class variable:
protected int Diameter;