您可以定义构造函数所需的任何参数,但是有必要将超类的一个构造函数作为自己的构造函数的第一行来调用。可以使用
super()或来完成
super(arguments)。
public class CMainCharacter extends CAnimatedSprite { public CMainCharacter() { super("your pFn value here", 0, 0); //do whatever you want to do in your constructor here } public CMainCharacter(String pFn, int pWidth, int pHeight) { super(pFn, pWidth, pHeight); //do whatever you want to do in your constructor here }}


