运行 ❯
获取您自己的
C#
服务器
×
更改方向
更改主题,暗/亮
转到 Spaces
using System; namespace MyApplication { // Create a Car class class Car { public string model; // Create a field // Create a class constructor for the Car class public Car() { model = "Mustang"; // Set the initial value for model } static void Main(string[] args) { Car Ford = new Car(); // Create an object of the Car Class (this will call the constructor) Console.WriteLine(Ford.model); // Print the value of model } } }
Mustang