有如下程序,该程序运行后的输出结果是。#inclu
有如下程序,该程序运行后的输出结果是()。
#include<iostream>
using namespace std;
class sample
{
private:
int x,y;
public:
sample(int i,int j)
{
x=i;
y=j;
}
void disp()
{
cout<<"disp1"<<endl;
}
void disp()const
{
cout<<"disp2"<<endl;
}
};
int main()
{
const sample a(1,2);
a.disp();
return 0;
}答案
B