The general concept used there, Anonymous Classes
In fact, you did to create a new subclass of the Application class by overriding (or implementing) the method in the subclass. Since the subclass is not anonymous (anonymous), you cannot create additional instances of this class.
You can use the same technique to implement the interface or create an instance of an abstract class if you implement all the necessary methods in your definition.
source share