创建一个Car
的对象,名为myObj
,并用它来设置maxSpeed
到 200
。
class Car
{
int maxSpeed;
static void Main(string[] args)
{
@(3) @(5) = @(3) @(3)();
@(5).@(8) = @(3);
Console.WriteLine(myObj.color);
Console.WriteLine(myObj.maxSpeed);
}
}
class Car
{
int maxSpeed;
static void Main(string[] args)
{
Car myObj = new Car();
myObj.maxSpeed = 200;
Console.WriteLine(myObj.color);
Console.WriteLine(myObj.maxSpeed);
}
}