I want to validate a parameter sent to a method, it must be an interface type. What to ask?
void (Class interfaceType){
if (thisisnotaninterface){
You have got a Class#isInterface() method that does exactly what you want: -
if (!interfaceType.isInterface()) {
throw...
}
For a normal java object you can always use instanceof
.
If Test implements Testable
Test test = new Test();
test instanceof Testable
will be true
Just use Class#isInterface() to check that
And seriously, you should be reading the Javadocs before asking here.