Top "Protected" questions

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

What is the difference between public, protected, package-private and private in Java?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, …

java private public protected access-modifiers
What is the difference between public, private, and protected?

When and why should I use public, private, and protected functions and variables inside a class? What is the difference …

php oop private public protected
What are access specifiers? Should I inherit with private, protected or public?

I am confused about the meaning of access modifiers with respect to inheritance. What is the difference between inheritance involving …

c++ class private protected
Why can a class not be defined as protected?

Why can we not define a class as protected? I know that we can't, but why? There should be some …

java class protected
How to get protected property of object in PHP

I have a object having some protected property that I want to get and set. The object looks like Fields_…

php object protected php-5.2
What is the difference between protected and private?

I don't understand the difference between protected and private members or methods, as I assumed both will hide the member …

c++ oop class private protected
Revert a merge commit from a protected branch on GitHub.com

We have protected our develop branch on GitHub so that nobody downstream can push their commit directly. The commits need …

git github merge protected git-revert
Protected and private methods in Rails

Method visibility in Ruby (public, protected, and private methods) has been well explained in places like this blog post. But …

ruby-on-rails ruby visibility private protected
Isn't "package private" member access synonymous with the default (no-modifier) access?

I am a little confused over the term "package private" that some of the documentation uses, along with the usage …

java terminology protected access-modifiers package-private
What are practical uses of a protected constructor?

Why would anyone declare a constructor protected? I know that constructors are declared private for the purpose of not allowing …

c++ constructor protected