base关键字
using System;namespace test
{
class text
{
private static int r=10;
public int new1(int a,int b)
{
return a+b;
}
public static int attribute1
{
get{ return r; }
set{ r=value; }
}
}
class newtext:text
{
private int s;
//private int u;
public int attribute
{
get{ return s;}
set{s=value;}
}
public static void Main()
{
newtext ucdos=new newtext();
// Console.WriteLine(newtext.qiu);
Console.WriteLine(base.new1(4,6));
}
}
}
为什么通过base来调用基类中的方法会出错呢???