📜  C# 类成员 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:55.746000             🧑  作者: Mango

代码示例1
//Create a Car class with three class members: two fields and one method.

// The class
class MyClass
{
  // Class members
  string color = "red";        // field
  int maxSpeed = 200;          // field
  public void fullThrottle()   // method
  {
    Console.WriteLine("The car is going as fast as it can!");
  }
}