public PublicClass() { //inaccessible due to protection level. this.privateClass = new PrivateClass(); //works! this.privateClass = PrivateClass.GetInstance(); }
public PublicClass() { // can't be called, privateClass's ctor/method is private // privateClass = newPrivateClass(); // can be called, this static method is public privateClass = PrivateClass.GetInstance(); // can't be called, it's private // privateClass.DoWork(); }