Definition of public,protected and private acess specifier in java.
Answers
Answered by
2
Protected data member and method are only accessible by the classes of the same package and the subclasses present in any package. You can also say that the protected access modifier is similar to default access modifier with one exception that it has visibility in sub classes. Classes cannot be declared protected.
Mkambozz1322:
brain list markk plzz
Answered by
1
Public can be accessed anywhere even is subclasses and everywhere.
Protected can be accessed within the same class and subclass but not everywhere
Private can be accessible only within class itself within same package and no where else
Similar questions