深入.NET 第四章上机3 模拟小汽车
来源:互联网 发布:开发方向 编程 编辑:程序博客网 时间:2024/04/29 06:13
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()); } }}
0 0
- 深入.NET 第四章上机3 模拟小汽车
- 深入.NET平台 第四章 上机2 员工薪资
- 深入.NET 第四章 上机4 点餐
- 深入.NET 第七章上机2上机3 员工工作
- 深入。NET 第六章上机2+3
- 深入.net第四章
- 深入。NET 第四章 遥控器
- 第四章上机3-5
- 深入.NET和C#第二章上机3
- C# 第四章 上机练习模拟顾客点餐
- c#第四章深入String类上机题2
- S2 深入.NET 第二章 上机题
- 深入.NET 第二章 上机练习1
- 深入.NET 第二章 上机练习2
- 深入.NET 第六章 上机1
- 深入.NET 第六章 上机4
- 深入.NET 第七章 上机1 演奏
- 第四章 上机4
- Properties的用法
- iOS NSCondition讲解
- linux下手工启动oracle centos下手动启动oracle
- React Router基础教程
- Multi-conditional Latent Variable Model for Joint Facial Action Unit Detection
- 深入.NET 第四章上机3 模拟小汽车
- 【Js应用实例】图片预览
- POJ1862:Stripies(优先队列)
- C primer plus 字符输入输出
- 关于工程头文件的处理
- 蓝桥杯 ADV-233 算法提高 队列操作
- Android应用开发性能优化完全分析
- yum安装命令回滚彻底删除安全的依赖包
- PCB四层板设计步骤