What type define an argument to make sure this is of determinate class and implements determinate interface? I’m using <T extends MyBaseClass & MyInterface> for argument type in method definition but my argument not extends MyBaseClass, IS of MyBaseClass type.
I want to make sure that the argument that I recive are of MyBaseClass type and implements MyInterface
What type define an argument to make sure this is of determinate class and
Share
I’m going to assume that you are asking if you can do something like this —
The answer is yes, you can. If you try passing an argument into this method thats YourBaseClass, but does not implement YourInterface, then the code will not compile.