KnowledgeBoat Logo

Computer Applications

Differentiate between private and protected visibility modifiers.

Java Classes

ICSE 2010

ICSE 2012

45 Likes

Answer

Private members are only accessible inside the class in which they are defined and they cannot be inherited by derived classes. Protected members are also only accessible inside the class in which they are defined but they can be inherited by derived classes.

Answered By

25 Likes


Related Questions