class CoOrds
{
public int x, y;
public CoOrds() {
x = 0;
y = 0;
}
public CoOrds(int x, int y) {
this.x = x;
this.y = y;
}
}
public CoOrds toto() {
CoOrds B = new CoOrds(3, 2);
return B;
}
private void result_Click(object sender, EventArgs e) {
l6.Text = "";
CoOrds D = new CoOrds();
D = toto();
l6.Text = "(" + D.x + "," + D.y + ")";
}
次のエラーが発生します:
Error 2 Inconsistent accessibility: return type 'johny.Form1.CoOrds' is less accessible than method 'johny.Form1.toto()