Top "Protected" questions

`protected` is an access specifier in object-oriented languages.

Python - Access to a protected member _ of a class

Given a class with some protected members and a public interface to modify them, when is it generally accepted to …

python oop attributes protected
Why protected can be access in same Package without inheritance in java?

Modifier Class Package Subclass World public Y Y Y Y protected Y Y Y N no modifier Y Y N …

java protected
Properties for Class and Its Subclasses Only

Is it possible to define properties that are only available to the class they are defined in, and that class's …

objective-c properties protected instance-variables
Is it possible to mock protected properties and methods

Is it possible to mock a protected property with PHP Mockery? I got a class with a method, I will …

php mocking phpunit protected mockery
Java: protected access across packages

I would like to understand what's happening in the example below (where a protected member is being accessed from outside …

java inheritance packages protected
Best practices to test protected methods with PHPUnit (on abstract classes)

With PHPUnit and PHP >= 5.3 it is possible to test protected methods. The following page at stackoverflow outlined the best …

php methods phpunit abstract protected
Workaround to accomplish protected properties in Objective-C

I've been trying to find a workaround to declare @protected properties in Objective-C so only subclasses in the hierarchy can …

objective-c properties protected
Why can't I use protected constructors outside the package?

Why can't I use protected constructors outside the package for this piece of code: package code; public class Example{ protected …

java protected access-modifiers
Reasons to use private instead of protected for fields and methods

This is a rather basic OO question, but one that's been bugging me for some time. I tend to avoid …

oop visibility private protected
Does static class contain only static method in java?

I have found code in which static class contains methods that are not declared static. Compiler doesn't display any warning. …

java class methods static protected