I would like to save a type called App inside the set. App must be an enumeration that implements the App interface.
Set<App> myApps;
I defined the interface like this ...
interface App<T extends Enum<T>> {}
It almost works, for example, you cannot do this ...
class MyClass implements Application<MyClass> {}
However, you can do it ...
enum MyEnum implements Application<MyEnum> {} class Myclass implements Application<MyEnum> {}
It is not right. I just want the enums to implement this interface, how can I provide this?
java enums interface
Gen
source share