きもい呼び方


無名インタフェースと骨格実装を使ったキモイよびかた。
インスタンス生成したそのタイミングでしか呼べないというw

package sample;

public class ExecuteMain {

	public interface Operation<T> {
	}

	public static void main(String[] args) {
		Integer integer = new Operation<Integer>() {
			public Integer execute() {
				return new Integer(111);
			}
		}.execute();
		System.out.println(integer);
	}
}