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

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
主站蜘蛛池模板: 武城县| 会宁县| 博乐市| 朔州市| 天津市| 德庆县| 新巴尔虎左旗| 舞钢市| 四子王旗| 万州区| 新闻| 兰州市| 吉木乃县| 廊坊市| 木兰县| 永济市| 龙胜| 滦平县| 方正县| 石阡县| 集贤县| 汝州市| 友谊县| 城固县| 信宜市| 嘉荫县| 锦州市| 万盛区| 礼泉县| 广德县| 文山县| 客服| 拉萨市| 香格里拉县| 霍邱县| 梅河口市| 石家庄市| 阳江市| 绥棱县| 乌审旗| 高阳县|