最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

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

類和類的引用5

2023-02-12 11:57 作者:此城過客  | 我要投稿

namespace ConsoleApp2//主函數(shù)

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? Add ab = new Add();//引用加法類

? ? ? ? ? ? ab.a = 20;

? ? ? ? ? ? ab.b = 10;

? ? ? ? ? ? ab.Add1();


? ? ? ? ? ? Reduce ac = new Reduce();//引用減法類

? ? ? ? ? ? ac.a = 20;

? ? ? ? ? ? ac.b = 10;

? ? ? ? ? ? ac.Reduce1();

? ? ? ? ? ? Console.ReadKey();

? ? ? ? }

? ? }

}

============================================================

namespace ConsoleApp2

{

? ? class Add

? ? {

? ? ? ? public int a;//類的特征

? ? ? ? public int b;//類的特征

? ? ? ? public void Add1()

? ? ? ? {

? ? ? ? ? ? int ab = a + b;//類的邏輯,或者行為

? ? ? ? ? ? Console.WriteLine(ab);//類的邏輯,或者行為

? ? ? ? }

? ? }

}

============================================================

namespace ConsoleApp2

{

? ? class Reduce

? ? {

? ? ? ? public int a;//類的特征

? ? ? ? public int b;//類的特征

? ? ? ? public void Reduce1()

? ? ? ? {

? ? ? ? ? ? int ac = a * b;//類的邏輯,或者行為

? ? ? ? ? ? Console.WriteLine(ac);//類的邏輯,或者行為

? ? ? ? }

? ? }

}


類和類的引用5的評論 (共 條)

分享到微博請遵守國家法律
苗栗市| 敦煌市| 上林县| 镇巴县| 无锡市| 老河口市| 个旧市| 泽库县| 芜湖县| 通榆县| 无锡市| 南陵县| 平利县| 随州市| 莱阳市| 平潭县| 宜州市| 大安市| 中牟县| 乌拉特中旗| 肇庆市| 栖霞市| 林西县| 天全县| 获嘉县| 上饶市| 景洪市| 开封市| 吐鲁番市| 桃园市| 永德县| 枞阳县| 定兴县| 白河县| 玉溪市| 亳州市| 勐海县| 封开县| 台南县| 任丘市| 文山县|