官术网_书友最值得收藏!

Adding a virtual function

Now, in the next stage, we will add a virtual function called Perimeter. For this, enter the following beneath the closed curly brace:

public virtual string Perimeter()

Again, we'll centralize as much as we can. So, enter the following within a set of curly braces below this line:

return $"The perimeter of {name} is ";

The specific name can come from this line, because the name instance variable is declared above in private string name. However, the Perimeter will come from the derived classes.

So now, enter the following beneath the preceding closed curly brace:

public class Square : Quad
主站蜘蛛池模板: 南雄市| 谢通门县| 白朗县| 杭州市| 浮梁县| 新绛县| 双江| 潼南县| 邵东县| 芮城县| 英山县| 清水河县| 韩城市| 永顺县| 沈阳市| 萝北县| 恩施市| 康乐县| 壤塘县| 绥中县| 武定县| 莱芜市| 临夏市| 卓资县| 来凤县| 廉江市| 贵州省| 黔江区| 德钦县| 同仁县| 天峻县| 哈巴河县| 嘉荫县| 巴南区| 城固县| 姚安县| 新乡市| 海林市| 柳林县| 翁牛特旗| 黔南|