One of hundreds of answers available with our premium content service.
A: The code you are looking at declares an inline anonymous class that implements an interface, which has a similar effect. This declaration does not instantiate the interface, but defines the type of the anonymous class, which has no name of its own. This approach is often used in old-style Abstract Windowing Toolkit (AWT) or Swing applications where a class is required to fulfil a minimal interface and it is not necessary to retain a reference to it by assignment.
… full answer hidden
Premium members click below for full answer
This code seems to be instantiating an interface!