Sounds like Java's anonymous classes. Quite a useful feature, actually.
It's only useful because Java lacks first class functions and syntax for lambdas. This is the single most irritating thing about Java to me. When this is fixed with the release of 8, the only thing Java will be missing is a really good implementation of persistent data structures a la Clojure.
Sounds like Java's anonymous classes. Quite a useful feature, actually.