Access level: default vs. protected

The following table shows the difference between default and protect access level. Notice the difference between reference and inherited.

java protected and default

Category >> Classes & Interfaces >> Versus  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
String foo = "bar";
  • Access level modifiers determine whether other classes can use a particular field or invoke a particular method.

  • shutear

    A wonderful explanation of the accessibility of protected and default in java.

  • Wangdu

    Can you explain what u want to say?

  • Raju

    What’s this???

  • aaa