Advertisements
Advertisements
प्रश्न
Differentiate between private and protected visibility modifiers.
अंतर स्पष्ट करें
उत्तर
S. No. | Private | Protected |
1. | Private members are only visible within the class where they were defined. | Protected members are visible to classes within the same package and to subclasses (including those from other packages). |
2. | Private elements are not shared with other classes during inheritance. | Protected elements can be applied to derived classes during inheritance. |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?