class funcA implements FunctionArrayInterface // 函數A { public void runit() { System.out. } }
class funcB implements FunctionArrayInterface // 函數B { public void runit() { System.out.println("你運行了函數 funcB"); } }
class funcC implements FunctionArrayInterface // 函數C { public void runit() { System.out.println("你運行了函數 funcC"); } }
public class Untitled1 { public static void main(String args[]) { FunctionArrayInterface[] funcs = new FunctionArrayInterface[3]; // 利用數組進行批量處理 funcs[0] = new funcA(); funcs[1] = new funcB(); funcs[2] = new funcC();