Top "Private" questions

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

How to make a real private instance variable?

I want to make an instance variable that can't be accessed from outside. Is something like that possible in objective-c? …

objective-c private visibility instance-variables
Java: accessing private constructor with type parameters

This is a followup to this question about java private constructors. Suppose I have the following class: class Foo<…

java reflection constructor private
When to use @objc in Swift?

In Swift, I see some methods like: @objc private func doubleTapGestureRecognized(recognizer: UITapGestureRecognizer) I was wondering, when to use @objc? …

ios objective-c swift selector private
Calling private function within the same class python

How can i call a private function from some other function within the same class? class Foo: def __bar(arg): #…

python function call private
Private IP Address Identifier in Regular Expression

I'm wondering if this is the best way to match a string that starts with a private IP address (Perl-style …

regex ip-address private
JavaDoc for private / protected methods?

Should I write JavaDoc for private or protected methods? And what about private variables? I see class examples on my …

java javadoc private protected
When would I want to make my private class static?

In general, are there any benefits in declaring a private class as static? In what cases would I want to …

java class static private
When do we need a private constructor in C++

I have a question about private constructor in c++, if the constructor is private, how to create an instance of …

c++ constructor private
How to generate RSA private key using OpenSSL?

I want to know how to generate RSA private key using OpenSSL library in my C source file. I know …

c openssl key rsa private