Top "Protected" questions

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

Is there a use for making a protected destructor virtual?

/*Child is inherited from Parent*/ class Parent { public: Parent () //Constructor { cout << "\n Parent constructor called\n" << …

c++ inheritance protected virtual-destructor
protected vs public constructor for abstract class? Is there a difference?

This question is out of curiosity. Is there a difference between: public abstract class MyClass { public MyClass() { } } and public abstract …

c# constructor public protected
C++ why use public, private or protected inheritance?

Well there is enough information about this subject. For example this thread was very clear to me: Difference between private, …

c++ inheritance private public protected
Why can't you have a protected abstract class in Java?

I have an abstract class which looks like: abstract class AbstractFoo implements Bar { //Code goes here } However when I try …

java blackberry java-me abstract protected
Can't access protected member in base class from derived class

Heres my code : #include <iostream> #include <cmath> #include <sstream> using namespace std; class root { …

c++ public protected inheritance
C# protected members accessed via base class variable

It may seems rather newbie question, but can you explain why method Der.B() cannot access protected Foo via Base …

c# inheritance protected base-class
How do I unit test a protected method in C++?

How do I unit test a protected method in C++? In Java, I'd either create the test class in the …

c++ unit-testing nunit protected
Accessing protected member functions from test code in C++

I've been racking my brain trying to think of the best way to access a protected member function from some …

c++ testing protected
Can you ever have too many "protected virtual" methods?

Here's a question for those of you with experience in larger projects and API/framework design. I am working on …

c# .net virtual protected
Why does the "protected" modifier in Java allow access to other classes in same package?

What is the reason that in Java, a member with a "protected" modifier can not only be accessed by the …

java inheritance protected