看看这个程序是如何运行的

看看这个程序是怎么运行的
类A是怎么被调用的?不懂


C/C++ code
#include<iostream>
using namespace std;
class A
{
    int value;
public:
    A();
    A(int val);
    ~A();

};

class B
{
    int value;
public:
    A x;
    B();
    B(int val);
    void disp();
    ~B();

};

A::A()
{
    cout<<"A Constructor"<<endl;
    value=0;
}

A::A(int val)
{
    cout<<"A Constructor"<<endl;
    value=val;

}

A::~A()
{
    cout<<"A Destructor"<<endl;
}

B::B()
{
    cout<<"B Constructor"<<endl;
    value=0;
}
B::B(int val)
{
    cout<<"B Constructor"<<endl;
    value=val;
}
void B::disp()
{
    cout<<"value="<<value<<endl;
}


B::~B(){cout<<"B Constuctor"<<endl;}

void main()
{
    B a(2);
    a.disp();

}


------解决方案--------------------
输出结果:
A Constructor
B Constructor
value=2
B Constuctor
A Destructor
请按任意键继续. . .
因为类中的数据成员会比构造函数先进行默认初始化.
而类B中有个A类型的数据成员x.
因此会调用A类的默认构造函数.即
C/C++ code

A::A()
{
    cout<<"A Constructor"<<endl;
    value=0;
}