While it is not possible to both extend a class and implement an interface, what you probably what to do can be achieved using delegation.
Just create an instance of Base
in the initializer of your anonymous class and use its methods from the methods you implement from Interface1
.
EDIT: My answer assumes that you only want to inherit from Base
because of its implementation, not because of its interface. This is a valid assumption given that the interface of Base
is not visible after assigning the object to a Interface1
variable. Therefore, I think it's better to use delegation here instead of creating a new class.