Originally posted by Sandya Bhaskara: what is this private protected modifier?is it same as default modifier?
private and protected are two different accessibility modifiers. private and protected are similar in that they apply only to members. private means that the member is not accessible from any other class -- even subclasses (nested classes can access private members in their top-level class). it is usually applied to fields and helper methods for classes. protected is not as restrictive, as it allows for access by classes that are either in the same package, or subclasses of that class.
c [ August 23, 2004: Message edited by: Chris Wash ]
posted 14 years ago
Oops.... i was sure that there was no "private protected" modifier... actually this was the question asked in a mock test..what is private protected modifier?..and some options were given ..i got doubt if there was a "private protected" modifier which i didn't know of...anyway the answer was none of the above...