I have a small query. I am aware of this concept of Anonymous classes but, how is the following piece of code valid?...Aren't we creating an instance of runnable instance? An we cant instantiate an interface..so how is this allowed..please explain.
And just to make the syntactical difference clear:
The curly braces after the parentheses are where you put the body of the concrete class that implements the methods in the interface. You an also create anonymous classes that extend abstract classes and concrete classes this way.