运行 ❯
获取您
自己的 C#
服务器
×
更改方向
更改主题,暗/亮
转至空间
using System; namespace MyApplication { class Car { public string model; public string color; public int year; // Create a class constructor with multiple parameters public Car(string modelName, string modelColor, int modelYear) { model = modelName; color = modelColor; year = modelYear; } static void Main(string[] args) { Car Ford = new Car("Mustang", "Red", 1969); Console.WriteLine(Ford.color + " " + Ford.year + " " + Ford.model); } } }
红色 1969 野马