hei。该语言是java。 我想扩展这个构造函数有参数的类。java,扩展类与主类的构造函数有参数
这是主类
public class CAnimatedSprite {
public CAnimatedSprite(String pFn, int pWidth, int pHeight) {
}
}
这是子类
public class CMainCharacter extends CAnimatedSprite {
//public void CMainCharacter:CAnimatedSprite(String pFn, int pWidth, int pHeight) {
//}
}
我怎样写正确的语法? 和错误是“构造函数不能应用于给定的类型”
它的工作原理。谢谢。解决了这个语法问题。 – r4ccoon 2010-01-13 12:21:47
如果我在根类中有多个构造函数,该怎么办?我需要为我的扩展类中的每个人做super()吗? – sammiwei 2012-01-30 19:07:46