Top "Protected" questions

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

How do you access protected Java method in thirdparty library?

Assume that you must access a protected method of a Java object that you receive somewhere in your code. What …

java methods protected
Protected Keyword C#

I want to know what is the meaning of protected in C#, why we use it, and the benefit of …

c# protected
Why can't I access protected java method even thought I've extended the class?

Here's the documentation for the protected method: /** Converts jmusic score data into a MIDI Sequence */ protected javax.sound.midi.Sequence …

java inheritance protected
How are java.lang.Object's protected methods protected from subclasses?

The keyword protected grants access to classes in the same package and subclasses (http://java.sun.com/docs/books/tutorial/…

java object protected
Public and private inheritance in C++

As we know from the literature for the public inheritance the object of child class (sub-class) also can be considered …

c++ inheritance private protected
When would I use package-private in Java?

I love access control in any language, but I find that in Java I almost never (if ever) use the …

java private protected access-control package-private
Using superclass "protected final" methods to keep common code for subclasses

As a (pedantic) beginner Java programmer I would like to know, is it a good practice to move a common …

java inheritance final protected
protected data in abstract class

My question involves specifically Java, abstract classes, and the use of protected data. I am being told that all the …

java abstract protected
Why is protected constructor raising an error this this code?

One question about protected constructor. I learnt that the protected constructor can be used in the derived class. How ever, …

c++ constructor protected
Understanding java's protected modifier

I have a class called A in package1 and another class called C in package2. Class C extends class A. …

java visibility protected access-modifiers