Top "Private" questions

Private is a way of encapsulation in object-oriented programming.

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
Does Python have “private” variables in classes?

I'm coming from the Java world and reading Bruce Eckels' Python 3 Patterns, Recipes and Idioms. While reading about classes, it …

python class private
private final static attribute vs private final attribute

In Java, what's the difference between: private final static int NUMBER = 10; and private final int NUMBER = 10; Both are private and …

java static attributes private final
What is the use of a private static variable in Java?

If a variable is declared as public static varName;, then I can access it from anywhere as ClassName.varName. I …

java variables static private
How to read the value of a private field from a different class in Java?

I have a poorly designed class in a 3rd-party JAR and I need to access one of its private fields. …

java class reflection field private
Cloning a private Github repo

I have a private repository on Github for a project I'm working on. Until now I had only worked on …

git github private
Change private static final field using Java reflection

I have a class with a private static final field that, unfortunately, I need to change it at run-time. Using …

java reflection static private final
Defining private module functions in python

According to http://www.faqs.org/docs/diveintopython/fileinfo_private.html: Like most languages, Python has the concept of private …

python function module private
Do subclasses inherit private fields?

This is an interview question. Does subclasses inherit private fields? I answered "No", because we can't access them using the "…

java oop inheritance private