首页上一页 1 下一页尾页 1 条记录 1/1页
C#中自己创建一个类,在该类中创建一个方法,在该方法之外创建一个该类的对象,该对象为何不能引用该方法?如下代码
class XiaoFei
{
XiaoFei jilu = new XiaoFei();
jilu.xiaofei();
void xiaofei()
{
Console.WriteLine("信用卡消费记录\n");
Card pcard = new Card() { Money = "8000" };
Console.WriteLine("信用卡总额度:"+pcard.Money+"\n");
Card scard = pcard;
scard.Money = "3000";
Console.WriteLine("信用卡消费记录:" + pcard.Money + "\n");
Console.Read();
}
}