国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

【轉載】#346

2019-11-17 03:18:24
字體:
來源:轉載
供稿:網友

【轉載】#346 - Polymorphism

Recall that polymorphism is one of the three core PRinciples of object-oriented programming.

Polymorphism is the idea that the same code can act differently, depending on the underlying type of the object being acted upon. The type of the object is determined at run-time, rather than at compile-time.

In C#, you can use a variable declared as a base type to refer to instances of one or more derived types. Polymorphism allows you to call a method that exist in the base type but whose implementation exists in the derived types. The appropriate method in the derived type will be called, based on the type of the object.

1 Dog d;2 3 d = new Terrier("Jack", 15);4 d.Bark();    // Terrier.Bark is called5 6 d = new Shepherd("kirby", 12);7 d.Bark();    // Shepherd.Bark is called

原文地址:#346 - Polymorphism


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 定襄县| 五华县| 岳阳市| 丰城市| 南部县| 苏州市| 孟连| 贡山| 布拖县| 乌鲁木齐市| 宣威市| 萨迦县| 三台县| 双牌县| 安化县| 清流县| 永和县| 揭东县| 上栗县| 舟曲县| 宁阳县| 南宁市| 远安县| 同仁县| 织金县| 阿拉尔市| 石台县| 淮南市| 额济纳旗| 建阳市| 元氏县| 金平| 乐昌市| 舞阳县| 阳信县| 赣州市| 巨鹿县| 铜川市| 桃园市| 永吉县| 如东县|