Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Access Specifier

class

sub-class

package

world

private

x

 

 

 

protected

x

x*

x

 

default

x

x*

x

 

public

x

x

x

x

*For referencing protected members, the accessing class has to be a sub-class and in any (possibly different) package or should also be in the same package.

*Default members can be referenced only within the same package.

Classes and class members should be given the minimum access possible so that malicious code has the least chance to manipulate the system.

...