I was thinking, does C++ or Java have a way to do something like this
Interface IF1{
....
};
Interface IF2{
....
};
function f(Object o : Implements IF1, IF2){
...
}
meaning a typesystem that allows you to require implementation of interfaces.
You can do this in Java:
This way, you force
Ito implement your two interfaces, otherwise it won’t even compile.