protected Java Keyword

The protected keyword is an access control modifier that may be applied to a class, a method or a field (a variable declared in a class).

Examples

  public class MyPublicClass
  {
     protected class MyPrivateClass
     {
     }
	 
     protected int i;
 
     protected String myMethod()
     {
       <statements>
     }
  }
  

Remarks

Related Topics

private Java Keyword

public Java Keyword