public void class person
{
public person()
{
private int age(get;set;)
}
}
public static class class1
{
public static void say( this.person person , int age )
{
}
}
使用
person p = new person();
p.say(10);
意义是对于封装好的类可以添加方法
public void class person
{
public person()
{
private int age(get;set;)
}
}
public static class class1
{
public static void say( this.person person , int age )
{
}
}
使用
person p = new person();
p.say(10);
意义是对于封装好的类可以添加方法
本文标题:C#的扩展方法
本文链接:https://www.haomeiwen.com/subject/mmhpfftx.html
网友评论