VB默认属性怎么定义在C#里面?
Property ASDF As String = "Hello"这个怎么写? --------------------编程问答-------------------- 在构造函数中赋给默认值:
class A--------------------编程问答-------------------- 我觉得还是在方法中给默认值比较好
{
public A(){ASDF = "Hello";}
public string ASDF {get; set;}
}
class A
{
public string ASDF
{
get { return ASDF??"Hello"; }
set { ASDF = value; }
}
}
补充:.NET技术 , C#