????????c++??????У????????java??????java???????????????c++???飬????????????c++?????????????????????£??????c++???????????????vc++6.0??
????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6     A(){
7         cout<<"this a"<<endl;
8     }
9     ~A(){cout<<"a dead"<<endl;}
10     class B
11     {
12     public:
13         B(){cout<<"this b"<<endl;}
14         ~B(){cout<<"b dead"<<endl;}
15     };
16     B b;
17 };
18 class c:public A
19 {
20 };
21 int main(int argc?? char * argv[])
22 {
23     A a;
24     return 0;
25 }
??????????????????????c++????????????????vc++6.0??????
???????B??????????????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6     A(){
7         cout<<"this a"<<endl;
8     }
9     void getA(){cout<<"i am getA()"<<endl;}
10     ~A(){cout<<"a dead"<<endl;}
11     class B
12     {
13     public:
14         B(){cout<<"this b"<<endl;}
15         ~B(){cout<<"b dead"<<endl;}
16         void getB(){cout<<"i am getB()"<<endl;}
17
18     };
19     B b;
20 };
21 int main(int argc?? char * argv[])
22 {
23     A a;
24     a.b.getB();
25         A::B b;
26         b.getB();
27     return 0;
28 }
???????????????getB()??????????????????????????????????????????????????B???б???????????????????????
1 #include <iostream>
2 using namespace std;
3 class A
4 {
5 public:
6     A(){
7         cout<<"this a"<<endl;
8     }
9     void getA(){cout<<"i am getA()"<<endl;}
10     ~A(){cout<<"a dead"<<endl;}
11     class B:public A
12     {
13     public:
14         B(){cout<<"this b"<<endl;}
15         ~B(){cout<<"b dead"<<endl;}
16         void getB(){cout<<"i am getB()"<<endl;}
17
18     };
19     B b;
20 };
21
22 int main(int argc?? char * argv[])
23 {
24     A a;
25     a.b.getB();
26     A::B b;
27         b.getD();
28     return 0;
29 }