还是出错~~
class Program
{
public class tank
{
public double weight;
public double oil;
public double distance;
public void Drive(double oil)
{
oil = weight * distance * 0.1;
}
public void ShowState(double x, double y)
{
weight = x;distance = y;
}
}
class Test
{
public static void Main()
{
tank t = new tank(2000,500);
t.ShowState();
t.Drive(500);
t.ShowState();
}
}
[解决办法]
tank根本没有两个参数的重载。
ShowState需要2个参数却没有。
这程序根本不通。
[解决办法]
butong
tank t = new tank();
t.ShowState(2000,500);
[解决办法]
该回复于2012-05-28 09:41:14被版主删除
[解决办法]
太基础了, 好好学习吧
[解决办法]