外側のクラスには、内側のインターフェイス、内側の抽象クラス、および内側のクラスがあります。
OuterClassのouterMethod()メソッドを呼び出すと、
AKindBiz クラスのメソッドは、リストの内容のみを出力できます。
抽象クラス (CommonKindBiz) のメソッドが何も出力できないのはなぜですか?
public class OuterClass {
public void outerMethod( ) throws Exception{
ArrayList<String> list = new ArrayList<String>();
list.add("1111");
list.add("2222");
KindBiz biz = new AKindBiz();
biz.execute(list);
}
public interface KindBiz
{
public void execute( ArrayList<String> inputList) throws Exception;
public void preExec( ArrayList<String> inputList) throws Exception;
public void exec( ArrayList<String> inputList) throws Exception;
public void postExec( ArrayList<String> inputList) throws Exception;
}
abstract public class CommonKindBiz implements KindBiz
{
public void execute( ArrayList<String> inputList) throws Exception{
System.out.println("KindBiz.CommonKindBiz.execute ### inputList1 : " + inputList ); // Nothing printed.
this.preExec(inputList);
this.exec(inputList);
this.postExec(inputList);
}
public void preExec( ArrayList<String> inputList) throws Exception
{
System.out.println("KindBiz.CommonKindBiz.preExec ### inputList : " + inputList ); // Nothing printed.
}
public abstract void exec( ArrayList<String> inputList) throws Exception;
public void postExec( ArrayList<String> inputList) throws Exception
{
System.out.println("KindBiz.CommonKindBiz.postExec ### inputList : " + inputList ); // Nothing printed.
}
}
public class AKindBiz extends CommonKindBiz
{
@Override
public void exec( ArrayList<String> inputList) throws Exception
{
System.out.println("KindBiz.AKindBiz.exec ### inputList : " + inputList ); // "1111", "2222" printed.
}
}
}
前もって感謝します。