国产探花免费观看_亚洲丰满少妇自慰呻吟_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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 西城区| 上犹县| 中江县| 班玛县| 盐边县| 个旧市| 连江县| 临猗县| 屏南县| 朔州市| 鹤岗市| 屯昌县| 中宁县| 三都| 尚志市| 嘉峪关市| 明星| 赫章县| 裕民县| 石首市| 香河县| 会理县| 三门县| 奎屯市| 黄骅市| 闽清县| 垦利县| 扶绥县| 乡城县| 伊宁市| 沙雅县| 河西区| 永寿县| 织金县| 桐庐县| 大化| 新昌县| 柳江县| 黄龙县| 富宁县| 会泽县|