Difference b/t private modifier and protected | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Difference b/t private modifier and protected

14th Sep 2017, 8:02 PM
Rajnish Yadav
Rajnish Yadav - avatar
2 ответов
+ 7
Pls use the search bar in the Q&A. You'll find the answer... https://www.sololearn.com/discuss/710553/?ref=app
14th Sep 2017, 8:38 PM
Tashi N
Tashi N - avatar
+ 3
With private, ONLY the class the member was declared in can access the member. While protected allows sub classes to access the member. This also includes access to the same class, and from packages.
14th Sep 2017, 8:37 PM
Rrestoring faith
Rrestoring faith - avatar