阅读该程序,给出程序的输出结果。
#include <iostream.h>
class A
{
public:
A()
{
a1=a2=0;
cout<<"Default constructor called.\n";
}
A(int i,int j);
~A()
{
cout<<"Destructor called.\n";
}
void Print()
{
cout<<"a1="<<a1<<','<<"a2="<<a2<<endl;
}
private:
int a1,a2;
};
A::A(int i,int j)
{
a1=i;
a2=j;
cout<<"Constructor called.\n";
}
void main()
{
A a,b(5,8);
a.Print();
b.Print();
}