多选题 Given:
2. class Robot { }
3. interface Animal { }
4. class Feline implements Animal { }
5. public class BarnCat extends Feline {
6. public static void main(String[] args) {
7. Animal af = new Feline();
8. Feline ff = new Feline();
9. BarnCat b = new BarnCat();
10. Robot r = new Robot();
11. if(af instanceof Animal) System.out.print("1 ");
12. if(af instanceof BarnCat) System.out.print("2 ");
13. if(b instanceof Animal) System.out.print("3 ");
14. if(ff instanceof BarnCat) System.out.print ("4 ");
15. if(r instanceof Animal) System.out .print ("5 ");
16. }
17. }
What is the result?
【正确答案】 B
【答案解析】