N
Nike
I have a small question w.r.t nested class..
I see in many codes nested classes are declared as public..
First, of all my understanding is that you go in for a nested class if
you are sure that this class cannot exist on it's own..
So , generally this should be declared as private so that none can
instantiate this openly..
I need to know the following..
a)Is there any design advantage of having nested class as Public???
class A{
public:
class B{
};
B b;
}
I see in many codes nested classes are declared as public..
First, of all my understanding is that you go in for a nested class if
you are sure that this class cannot exist on it's own..
So , generally this should be declared as private so that none can
instantiate this openly..
I need to know the following..
a)Is there any design advantage of having nested class as Public???
class A{
public:
class B{
};
B b;
}