c#第三章课后作业3

来源:互联网 发布:软件项目评审表模板 编辑:程序博客网 时间:2024/05/16 19:12
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{    class Program    {        static void Main(string[] args)        {            car c = new car() { Name="奔驰",Color="蓝色",PP="德国",};            Console.WriteLine("我是一辆{0}车,{1},产地是{2}", c.Name, c.Color, c.pp);            Console.ReadLine();        }    }}

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{    class car    {        public string color;        public string name;        public string pp;        public string Name {            get {                return name;            }            set {                name = value;            }        }        public string Color        {            get            {                return color ;            }            set            {               color = value;            }        }        public string PP        {            get            {                return pp;            }            set            {               pp = value;            }        }    }}

0 0
原创粉丝点击