Possible to automate the implementation of interfaces?

Is it possible to have a superclass that has every subclass automatically implement a particular interface? Question is simple as that.

Thanks

Make the superclass implement the interface and all its descendants will as well.

I don’t want the superclass to implement it, just the descendants. I think with interfaces is the subclasses take the superclass’s implementation of the interface and not it’s own that is unique to that subclass.

Thanks

Basically, I want unique variations of the implementation of the interface for each subclass.

[quote=130507:@Oliver Scott-Brown]I don’t want the superclass to implement it, just the descendants. I think with interfaces is the subclasses take the superclass’s implementation of the interface and not it’s own that is unique to that subclass.

Thanks[/quote]
Right, you implement the interface int he superclass then you can override the methods in the subclass so each implementation is different. Or you can go about it the hard way and implement the interface individually for each subclass, but that is just extra work which can be avoided by implementing it in the superclass…

Create the interface
Then create a new class that implements the interface - this is the “base class”
Then create all your subclasses of that and away you go
Each only needs to implement the portion of the interface that is unique to it
Their implementation overrides the super class implementation
Everything else is common to the original implementor - the base class

That IS the way to do what your asking

Great thanks you both explained this well!