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

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

【轉載】#274

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

【轉載】#274 - Can't Overload if Methods Differ Only by ref and out Modifiers

You can overload a method in a class, i.e. define two methods with the same name, if the methods have different lists of parameters. The parameter lists must differ in the number of parameters or in their types.

For example, we can overload the Dog.Bark method if the parameters differ only in type:

1 public void Bark(int numBarks)2 {3   // implementation here4 }5 6 public void Bark(short numBarks)7 {8   // implementation here9 }

We cannot overload a method if the parameters differ only in a ref vs out modifiers:

1 public void FindDog(ref Dog aDog)2 {3   // implementation here4 }5 6 public void FindDog(out Dog aDog)7 {8   // implementation here9 }

原文地址:#274 - Can't Overload if Methods Differ Only by ref and out Modifiers


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 赞皇县| 景洪市| 修武县| 南和县| 磐石市| 蚌埠市| 门源| 定远县| 博罗县| 邵东县| 旅游| 陵水| 溧阳市| 郓城县| 西宁市| 固原市| 施甸县| 中卫市| 灌南县| 玉树县| 宣汉县| 同江市| 玉林市| 永嘉县| 宽甸| 寿光市| 兴山县| 子洲县| 额尔古纳市| 盐津县| 清河县| 张北县| 双峰县| 惠东县| 丰县| 浏阳市| 宽甸| 精河县| 同德县| 福贡县| 山丹县|