using System; public class Car { private string make; public string Make { get { return make; } set { make = value; } } } class Example1 { public static void Main() { Car myCar = new Car(); System.Console.WriteLine("Setting the car object's Make property to porsche"); myCar.Make = "Porsche"; System.Console.WriteLine("myCar.Make = " + myCar.Make); int i = System.Console.Read(); } }
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)