《JAVA程序设计》期末考试试题七.doc

《JAVA程序设计》期末考试试题 (七) 一、选择题 1. 请说出下列代码的执行结果 : B String s = abcd; String s1 = new String(s); if (s = = s1) System.out.println(the same); if (s.equals(s1)) System.out.println(equals); A.? the same equals B.? equals C.? the same D.? 什么结果都不输出 2. 下列有关 Java 中接口的说法哪个是正确的? B A.? 接口中含有具体方法的实现代码 B.? 若一个类要实现一个接口,则用到 “implements” 关键字 C.? 若一个类要实现一个接口,则用到“ extends ”关键字 D.? 接口不允许继承 3. 下列代码的执行结果是什么? B String s1 = aaa; s1.concat(bbb); System.out.println(s1); A.? The string aaa. B.? The string aaabbb. C.? The string bbbaaa. D.? The string bbb. 4. 如果有一个对象 myListener ( 其中 myL

文档评论(0)

1亿VIP精品文档

相关文档