国产探花免费观看_亚洲丰满少妇自慰呻吟_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());        }  }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 且末县| 石景山区| 福泉市| 曲松县| 民乐县| 阳原县| 湘潭县| 甘泉县| 桓台县| 赤城县| 巴彦淖尔市| 亚东县| 晋中市| 准格尔旗| 汉川市| 湾仔区| 泰和县| 天水市| 宁国市| 两当县| 堆龙德庆县| 修文县| 平远县| 新疆| 高安市| 乌海市| 茌平县| 北海市| 临澧县| 永顺县| 灵台县| 扶沟县| 安泽县| 炉霍县| 孝昌县| 晋宁县| 乌恰县| 孝感市| 绩溪县| 报价| 大埔区|