UNIT 1 (Concept 1) : Access Modifiers in java

By | June 2, 2013

Visibility of the properties  of class for different access modifiers 

——————————————————————————————————————–

1) From the same class

          Public , Protected, Private and Default

2) From any class in same package

          Public, Protected and Default

3) From a subclass in same package

          Public, Protected and Default

4) From subclass outside the same package

          Public and Protected (by inheritance)

5) From any non-subclass or class outside the package

          Public only

email

Leave a Reply

Your email address will not be published. Required fields are marked *