我想知道为什么我的子类没有正确继承。
如果我有...
public class ArithmeticOp{
//some constructor
public static void printMessage(){
System.out.println("hello");
}
}
和另一个班级
public class AddOp extends ArithmeticOp{
//some constructor
ArithmeticOp op = new ArithmeticOp();
op.printMessage(); //returns error
}
我的日食不断返回“令牌“printMessage”上的语法错误,此令牌后需要标识符”
有人可以帮忙吗?谢谢!还有其他方法可以从父类以及子类调用方法吗?非常感谢!