运行时将Parent.parentMethod2
或被Child.parentMethod2
调用Child.childMethod1
?
public class Parent
{
public void parentMethod1()
{
parentMethod2();
}
public void parentMethod2()
{
//do something
}
}
public class Child extends Parent
{
public void childMehod1()
{
parentMethod1();
}
@Override
public void parentMethod2()
{
//do something else
}
}