调用构造函数报错
public class Sprite
{
...
public Sprite(Animation anim)
{
this.anim=anim;
}
}
public class Player extends Sprite
{
...
public Player(Animation anim) //生成Sprite对象而不是Player对象????
{
super(anim);
state=STATE_NORMAL;
}
}
public class Test
{ Animation anima=new Animation();
Player player;
player=new Player(anim);//报错,未定义Player(Animation)
}
请问是什么原因,谢谢指点。
------解决方案--------------------楼主,写错了,是anima,不是anim!
Animation anima=new Animation();
player=new Player(anim);
------解决方案--------------------对啊.是楼主写错了.不过这种笔误是很正常的!这就是异常的好处!
------解决方案--------------------这种错误都找不出来??
服了