我有一個有點brainfart對我的基本知識傳承:從接口變量繼承?
public interface IDrawable
{
public double x, y;
object GetDrawable();
}
public class Beacon : IDrawable
{
public Beacon(string id, double x, double y)
{
this.id = id;
this.x = x;
this.y = y;
}
}
爲什麼沒有燈塔的構造能夠找到它的父定義的雙打x和y?
編寫代碼並嘗試提問之前,你的代碼甚至不會編譯! –