All pastes #756466 Raw Edit

Anonymous

public java v1 · immutable
#756466 ·published 2007-10-31 14:49 UTC
rendered paste body
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) ;	}	}