The protected and default access control levels are almost identical with one critical difference. A default memeber can be accessed only if the class accessing the members belong to the same package, whereas a protected member can be accessed [only through inheritence] by a sub class even if the subclass is in a different package.
No comments:
Post a Comment