Top "Protected" questions

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

Why can't I access C# protected members except like this?

This code: abstract class C { protected abstract void F(D d); } class D : C { protected override void F(D d) { } …

c# overriding protected access-modifiers
Protected static member variables

I've recently been working on some class files and I've noticed that the member variables had been set in a …

php static protected static-members
iOS distribution - parameters in itms-services protocol link for plist

I would like to pass the userid and password in the itms-services link so that the protected plist can be …

ios plist protected
subtle C++ inheritance error with protected fields

Below is a subtle example of accessing an instance's protected field x. B is a subclass of A so any …

c++ inheritance protected
Protected member access from different packages in java - a curiosity

package packageOne; public class Base { protected void display(){ System.out.println("in Base"); } } package packageTwo; public class Derived extends packageOne.…

java protected
How to access protected method in base class from derived class?

Here is a sample of code that annoys me: class Base { protected: virtual void foo() = 0; }; class Derived : public Base { private: …

c++ protected derived-class
accessing a protected member of a base class in another subclass

Why does this compile: class FooBase { protected: void fooBase(void); }; class Foo : public FooBase { public: void foo(Foo& fooBar) { …

c++ inheritance encapsulation protected
C++: Why does my DerivedClass's constructor not have access to the BaseClass's protected field?

I have a constructor attempting to initialize a field in a base class. The compiler complains. The field is protected, …

c++ inheritance constructor protected access-specifier
Overriding protected methods in Java

Test.java package a; import b.B; public class Test { public static void main(String[] v) { new A().test(); new …

java methods overriding protected
Protected access modifier in Java

I am having a little trouble understanding the protected access modifier in java (or the design behind it). I thought …

java protected access-modifiers