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

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

深入.NET 第四章上機3 模擬小汽車

2019-11-08 02:26:21
字體:
來源:轉載
供稿:網友
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 模擬汽車奔跑{    class PRogram    {        static void Main(string[] args)        {            Car car = new Car();            car.name = "奔馳";            car.color = "紅";            car.Address = "德國";             car.Run();            Car b = new Car("寶馬","銀灰","德國");            b.Run();            b.Run(200);                       Console.ReadLine();        }    }}
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Collections;namespace 模擬汽車奔跑{          class Car    {        public string name{get;set;}        public string color { get; set; }        public string Address { get; set; }                                                                                                                                                                                                                                                     public Car (){ }        public Car(string n,string c,string a)        {            this.name=n;            this.color = c;            this.Address = a;        }        public void Run()        {            Console.WriteLine("我是一輛{0}車,顏色是{1}色,產地在{2}!",                this.name, this.color, this.Address);        }        public void Run(int speed)        {            Console.WriteLine("我是一輛{0}車,顏色是{1}色,產地在{2},最高車速{3}!",                this.name, this.color, this.Address, speed.ToString());        }  }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 司法| 扶绥县| 大荔县| 额尔古纳市| 理塘县| 阳城县| 深水埗区| 霍山县| 沅江市| 郧西县| 开远市| 穆棱市| 临泉县| 玉田县| 宜川县| 汕尾市| 孙吴县| 衡东县| 巴彦县| 新建县| 墨玉县| 磴口县| 枝江市| 乌什县| 习水县| 雷山县| 阜新| 武鸣县| 揭西县| 南漳县| 团风县| 张家界市| 丹凤县| 长葛市| 南乐县| 阿拉善盟| 华阴市| 吉安市| 曲松县| 昔阳县| 永吉县|