Friday, 12 July 2013

Access Specifier in java

This table tells you which other classes can see your classes data members and member methods when you use access specifiers

private default protected public
Same Class
Same Package
Subclass
Same Package
Non-Subclass
Different Package
Subclass

Note: Using Child refernce
Different Package
Non-Subclass

No comments:

Post a Comment