private

Internal vs. Private Access Modifiers

What is the difference between the internal and private access modifiers in C#? ...

PHP: declare a class variable to be a stdClass object

This is probably pretty simple but I haven't been able to figure out how to phrase the question for Google, so here goes: So, I often do something like this... class foo { private $bar = array(); } ... to set some class property to be an array. However, I'd like to make a private property an object instead, something like this: ...

What's the cleanest way to defeat C++ access qualification?

I decided to work around a bug in GNU libstdc++ by accessing an internal variable. Recalling that Johannes solved the problem on his blog, I checked that out… but couldn't comprehend the code, aside from the basic concept of getting a static initializer to do the dirty work. So, I boiled it down to this, which is pretty compact. But, as...

Access private elements of object of same class

Is this legal? If not, will the following code allow this? class Foo { friend class Foo; } ...

Performance differences between static and non-static final primitive fields in Java

I recently ran across a class that had the following field declared: private final int period = 1000; In this particular case, the author had intended for it to also be static and since the value couldn't be altered at any point, there was no real functional reason not to declare it static, but it got me wondering how Java treats fina...

Private constructor

Hello, I have an object of class which has private constructor: class CL_GUIComponent { // ... private: CL_SharedPtr<CL_GUIComponent_Impl> impl; CL_GUIComponent(CL_GUIComponent &other); CL_GUIComponent &operator =(const CL_GUIComponent &other); CL_GraphicContext dummy_gc; }; I have a class which has a pointer t...

Why protected and private attributes are accessible by same class rather than by the same object ?

For example, we have the class Man If Man.age is protected, then I don't see why chuckNorris (instance of class Man) can change the protected/private attribute age of the object jackBauer (another instance of class Man). He shouldn't be able to do that (IMO). In my mind, the value of a protected/private attribute is supposed to belong ...

Copy javascript object with private member

Hi, I've looked all around and found nothing to help me. Why on earth can't I clone a javascript object with private members without making them quantum entangled? Just look at this code... It's a plain private property with getter and setter. Somehow if I call the public setter on one instance, the cloned one gets changed too. Why? Ca...

Private interface vs. private method - objective c

Hi, What is the difference between a private method and a private interface? For example, I know that if you define a method in an implementation and its interface does not mention it, it is considered a private method. I have also seen things such as: @interface Collector() @property (readonly) NSMutableDictionary *count; @end Insid...

Is "currentPlaybackTime" property of MPMoviePlayerController a private API

hello guys, I am not sure about this private API thing. Is the property "currentPlaybackTime", which is in the MPMediaPlayback Protocol of the MPMoviePlayerController a private API? I am asking, because this property is working fine but it is not listed in the MPMoviePlayerController Reference. Is it then a private one? By the way: i...

Can NHibernate set non-public properties?

Is it possible to setup NHibernate to load/persist a non-public property of a class? For example I may have an Item class as follows. public class Item { public int ItemID {get; set;} public string Name{get; set;} } With the following mapping: <class name="RCL.Item" table="Items"> <id name="ItemID" type="Int32" column="It...

Delphi: writing to the private ancestor's field in descendant class

I need to fix a third-party component. This component's class has private variable which is actively used by its descendants: TThirdPartyComponentBase = class private FSomeVar: Integer; public ... end; TThirdPartyComponent = class (TThirdPartyComponentBase) protected procedure Foo; virtual; end; procedure TThirdPartyComponent.F...

iOS 4.x bring app from background to foreground using private api

Hi All, In my app, I am placing a phone call due to which my app goes in background and suspended. After disconnecting the call instead of my app coming in foreground, native phone app comes into foreground. Is there any way by which my app comes into foreground (instead of native phone app) after disconnecting the call. If there is ...