无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

構(gòu)造函數(shù)的參數(shù)

2023-02-13 06:44 作者:此城過客  | 我要投稿

之前的構(gòu)造函數(shù),?public Customer(string arg1,string arg2,int arg3,string arg4)?

他的參數(shù)寫arg1,arg2,這樣在主程序里引用的時(shí)候,不知道是什么意思,不方便閱讀。因此構(gòu)造函數(shù)的參數(shù)可以這么寫:

namespace ConsoleApp4

{

? ? class Weapon

? ? {

? ? ? ? public string name;

? ? ? ? public string address;

? ? ? ? public int age;

? ? ? ? public string createTime;


? ? ? ? public Weapon(string name, string address, int age, string createTime)

? ? ? ? {

? ? ? ? ? ? this.name = name;//this代表當(dāng)前對(duì)象

? ? ? ? ? ? this.address = address;

? ? ? ? ? ? this.age = age;

? ? ? ? ? ? this.createTime = createTime;

? ? ? ? }

? ? }

}


構(gòu)造函數(shù)的參數(shù)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
边坝县| 涪陵区| 保定市| 昭苏县| 金寨县| 舟曲县| 高平市| 福鼎市| 宜都市| 新巴尔虎右旗| 偃师市| 英德市| 麻江县| 米脂县| 边坝县| 肃南| 宜兰市| 和田市| 威信县| 盐源县| 揭东县| 金乡县| 大邑县| 巴塘县| 牡丹江市| 九台市| 邮箱| 兴义市| 桂阳县| 调兵山市| 蓝山县| 新野县| 阿尔山市| 竹北市| 墨竹工卡县| 黄山市| 吴堡县| 乐山市| 紫阳县| 华安县| 平利县|