One of the cool things about Ruby is that it lets you re-define ("override") methods attached to objects, not just at the class level (as we typically think of with Java, C#, C++, etc.):
I've known all along that Java had this notion of an anonymous inner class, i.e., a situation where a non-instantiable entity (either an interface or an abstract class) can be instantiated directly as long as you immediately define its abstract methods. For example:
What I didn't realize until I tried it out today is that this works for regular Java classes, too:
Of course, it's still not as powerful as Ruby. Java can only re-define an object's method once: at object-creation time. Ruby can re-define a method on an object as many times as needed. But it still strikes me as interesting that this is allowed; presumably, it's a feature of Java's all-methods-are-virtual semantics.