I mainly want to do
class Parent{
public class Nested {
private Nested(){
}
Nested CreateNested(){
return new Nested ();
}
}
public Nested Foo(){
Nested n = (???).CreateNested ();
return n;
}
}
so that users of the class Parentcan see the class Nestedbut cannot create it (they can, however, get it from Parent). I know that for ordinary methods you can do this with an explicit implementation of the interface, but it does not work with constructors.
source
share