ここでは、パラメーター化されたコンストラクターが宣言されていますが、そのコンストラクターに対応するオブジェクトは作成されていません。しかし、出力はパラメーター化されたコンストラクターの実行である 10 20 です。なぜですか?
#include<iostream>
using namespace std;
class constructor
{
int x, y;
public:
constructor(int a = 10, int b = 20 )
{
x = a;
y = b;
}
void Display()
{
cout<< x << " " << y << endl;
}
};
int main()
{
constructor objBix;
objBix.Display();
return 0;
}