请帮忙解答 英文这题

帮忙解答下这题。该怎么解决 - J2SE当前位置:& &&&帮忙解答下这题。该怎么解决帮忙解答下这题。该怎么解决&&网友分享于:&&浏览:2次帮忙解答下这题。。。。求讲解 谢谢了Question No: 5interface MyInterface{}public class MyInstanceTest implements MyInterface{static Spublic static void main(String args[]){MyInstanceTest t = new MyInstanceTest();if(t instanceof MyInterface){System.out.println(&I am true interface&);}else {System.out.println(&I am false interface&);}if(s instanceof String){System.out.println(&I am true String&);}else {System.out.println(&I am false String&);}}}A.compile time errorB.runtime errorC.prints: “I am true interface” followed by “I am true String”D.prints: “I am true interface” followed by “I am false String”E.prints: “I am false interface” followed by “I am false String”F.prints: “I am false interface” followed by “I am true String”------解决方案--------------------虽然格式很乱,但是还是耐着性子看到了if(s instanceof String)这一行,编译错误,A没有继承、实现关系的类是无法instanceof的
------解决方案--------------------D s 被初始化为 null。 null instanceof XXX 总是 false
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有

我要回帖

更多关于 数学题在线解答 的文章

 

随机推荐