import java.io.File;public class Test { public Test(Function c) { /* Testing call to a function... */ c.fn(new File("test.txt"), new Integer(8), "yow"); } public static void oneParam(File f) { System.out.println(f.getName()); } public static void main(String[] args) { new Test(new Function() { @Override public Object fn(Object... args) { System.out.println("Got " + args.length + " arguments.."); for(Object o : args) { System.out.println(o.getClass()); } /* optionally do checks or just don't care */ oneParam((File)args[0]); return null; } }); } public static abstract class Function { public abstract Object fn(Object ... args) ; }}