abstract class Foobar
{
abstract void myAbstractMethod();
public void myConcreteMethod()
{
//busy code begin
myAbstractMethod();
// busy code complete
}
class childClass extends FooBar
{
@Override
public myAbstractMethod()
{
//busy code to make abstract method, concrete
}
}
這是可以接受的?這是正確的方法嗎?這是不好的設計?
是的,當然,你有沒有試過? – Aubin
是的,我嘗試過,它的工作原理。我只是不知道這種方法是否被忽視/糟糕的設計 – stackoverflow
爲什麼它不被接受? –