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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 绥德县| 瓦房店市| 富裕县| 抚远县| 长岛县| 宜黄县| 措美县| 定安县| 阳谷县| 如东县| 舞钢市| 萨嘎县| 霍山县| 长宁县| 万荣县| 宜黄县| 仲巴县| 丰台区| 绥化市| 唐海县| 正宁县| 右玉县| 民县| 安图县| 建瓯市| 天长市| 吴忠市| 玛纳斯县| 英山县| 门源| 弋阳县| 九江市| 郎溪县| 临夏县| 侯马市| 龙门县| 古田县| 石家庄市| 汕头市| 贵州省| 雅安市|