Top "Private" questions

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

clean C++ granular friend equivalent? (Answer: Attorney-Client Idiom)

Why does C++ have public members that anyone can call and friend declarations that expose all private members to given …

c++ design-patterns private friend
What's the difference between "= default" destructor and empty destructor?

I want to prevent the user of my class from using it as an automatic variable, so I write code …

c++ class c++11 destructor private
How to initialize a ConcurrentDictionary? Error: "Cannot access private method 'Add' here"

I have a static class in which I am using dictionaries as lookup tables to map between .NET types and …

c# dictionary private concurrentdictionary idictionary
Tuple struct constructor complains about private fields

I am working on a basic shell interpreter to familiarize myself with Rust. While working on the table for storing …

rust private tuple-struct
ObjectiveC: where to declare private instance properties?

I have the following class interface: @interface MyClass : NSObject @property int publicProperty; @end then the implementation: @interface MyClass() // class extension …

objective-c implementation private class-extensions
javascript private function access public variable

i have this class: function ctest() { this.var1 = "haha"; this.func1 = function() { alert(this.var1); func2(); alert(this.var1); } var …

javascript class private public
c# abstract methods: internally public and virtual?

Are abstract methods internally public and virtual in c#? All methods are, by default, private and if an abstract method …

c# abstract-class private public access-modifiers
How to make images hosted on Amazon S3 less public but not completely private?

I fired up a sample application that uses Amazon S3 for image hosting. I managed to coax it into working. …

ruby amazon-s3 heroku private acl
Able to use pointer to function to call private method of an external class

Based on the following answer to a recent question, I'm able to use a function pointer in order to call …

c++ private member-function-pointers
How to use Unit files in Delphi

I'm just trying to get the hang of separate units to make my code more encapsulated. I'm trying to get …

delphi private pascal public delphi-units