私有化属性后怎么调用?
private int car;public int Car
{
get{return car;}
private set {car = value;}
}
private set 以后,怎么给里面赋值啊?有啥方法? --------------------编程问答-------------------- 在其他类中要设置,只能反射。
在本类中可以设置。 --------------------编程问答-------------------- 比如你再写一个方法:
public void SetCar(int x) { Car = x; }
补充:.NET技术 , C#