why can't an interface inherit from a class ? the ...
# announcements
l
why can't an interface inherit from a class ? the use case would be using properties of that class in the interface's default function implementations
s
Because an interface has no storage, you can't instantiate it. A class has storage, it can be instantiated. If an interface were to inherit from a class, it would have storage and be a class (not an interface).
The interface can inherit from another interface that already has default method implementations.
l
then is the only way to achieve what i want to create another interface that "mirrors" the class ?
l
but if that class already inherits from another class ?
s
Take a look at interface delegation and see if that helps you do what you want to do.
l
oh yeah i've heard about that. will take a look, ty