Which access level is more restrictive "protected" or "default" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Which access level is more restrictive "protected" or "default"

31st Jan 2019, 1:56 PM
Mind To Machine šŸ’»šŸ•†
Mind To Machine šŸ’»šŸ•† - avatar
2 Answers
+ 2
Default is private, which is more restrictive than protected. Edit: Woops, that's not C++.
1st Feb 2019, 12:18 PM
Zen
Zen - avatar
+ 2
Zen in java default is not private, but it is more restrictive than protected in java the order of restrictiveness from most restrictive is: 1 private 2 default 3 protected 4 public
1st Feb 2019, 12:33 PM
Mind To Machine šŸ’»šŸ•†
Mind To Machine šŸ’»šŸ•† - avatar