Difference b/t private modifier and protected | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difference b/t private modifier and protected

14th Sep 2017, 8:02 PM
Rajnish Yadav
Rajnish Yadav - avatar
2 Answers
+ 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