Is there a way to decide whether a particular interface is an instanceof another interface with a switch statement?
 MainInterface inter = //load interface
 switch (inter) {
        case instanceof Interface1:
            Interface1 inter1 = (Interface1) inter;
            //execute methods of inter1
        case instanceof Interface2:
            Interface2 inter2 = (Interface2) inter;
            //execute methods of inter2
    }
Thanks for your help.
 
     
    