SATC答案3教案资料

上传人:men****ain 文档编号:131864014 上传时间:2020-05-10 格式:PDF 页数:32 大小:167.05KB
返回 下载 相关 举报
SATC答案3教案资料_第1页
第1页 / 共32页
SATC答案3教案资料_第2页
第2页 / 共32页
亲,该文档总共32页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《SATC答案3教案资料》由会员分享,可在线阅读,更多相关《SATC答案3教案资料(32页珍藏版)》请在金锄头文库上搜索。

1、SATC 答 案 3 精品文档 收集于网络 如有侵权请联系管理员删除 试题总计 70 总分 100 SUN JAVA 程序员 1 单选 1分 下列有关父类属性和方法继承规则的描述错误的是哪项 A 父类中 private修饰的属性和方法在子类中不被继承 B 父类中 public 修饰的属性和方法在子类中被继承且可访问 C 父类中 protected修饰的属性和方法在子类中被继承且可访问 D 父类中 default修饰的属性和方法在子类中被继承 若父类和子类在同一个 包中 则也可访问 2 单选 1分 在子类中调用父类中被覆盖的方法时需要使用哪项关键字 A this B super C new D

2、以上都不是 3 单选 1分 public class Pet private String name public Pet System out print 1 public Pet String name System out print 2 public class Dog extends Pet public Dog 精品文档 收集于网络 如有侵权请联系管理员删除 System out print 4 public Dog String name this System out print 3 执行 new Dog 棕熊 后程序输出是哪项 A 143 B 423 C 243 D 1134

3、 4 单选 1分 如果想要一个类不能被任何类继承的话 需要使用哪个关键字来 修饰该类 A abstract B final C static D new 5 单选 1分 现有 2 class Cat 3 Cat int c System out print cat c 4 5 class SubCat extends Cat 6 SubCat int c super 5 System out print cable 7 SubCat this 4 8 public static void main String args 9 SubCat s new SubCat 10 11 精品文档 收集于

4、网络 如有侵权请联系管理员删除 结果为 A cat5 B cable C cable cat5 D cat5 cable 6 单选 1分 现有 1 class Guy String greet return hi 2 class Cowboy extends Guy String greet return howdy 3 class Surfer extends Guy String greet return dude 4 5 class Greetings 6 public static void main String args 7 Guy guys new Guy new Cowboy

5、new Surfer 8 for Guy g guys 9 System out print g greet 10 11 结果为 A hi hi hi B hi howdy dude C 运行时异常被抛出 D 第 7 行出现一个错误 编译失败 7 单选 1分 现有 1 class Passer2 2 insert code here 精品文档 收集于网络 如有侵权请联系管理员删除 3 static int bigState 42 4 public static void main String args 5 bigState p2 go bigState 6 System out print

6、bigState 7 8 int go int x 9 return x 10 11 和 4 段代码片段 static Passer2 p2 new Passer2 final static Passer2 p2 new Passer2 private static Passer2 p2 new Passer2 final private static Passer2 p2 new Passer2 有多少行分别插入到第2 行 可以编译 A 0 B 1 C 3 D 4 8 单选 1分 现有 1 final class Tree 2 private static String tree tree

7、3 String getTree return tree 4 5 class Elm extends Tree 6 private static String tree elm 精品文档 收集于网络 如有侵权请联系管理员删除 7 public static void main String args 8 new Elm go new Tree 9 10 void go Tree t 11 String s t getTree Elm tree tree new Elm getTree 12 System out println s 13 结果为 A elm elm elm elm B tree

8、 elm elm elm C tree elm tree elm D 编译失败 9 单选 1分 现有 class TestMain static int x 2 static x 4 static public void main String args int y x 1 System out println y 和命令行 java TestMain 精品文档 收集于网络 如有侵权请联系管理员删除 结果为 A 3 B 5 C 编译失败 D 运行时异常被抛出 10 单选 1分 现有 1 import java util 2 class Banana3 3 public static void

9、main String args 4 int x 2 5 Banana3 b new Banana3 6 b go x 7 8 static x x 9 void go int x 10 x 11 System out println x 12 13 结果为 A 2 B 3 C 5 D 编译失败 精品文档 收集于网络 如有侵权请联系管理员删除 11 单选 1分 现有 1 abstract class Color2 2 insert code here 3 4 5 public class Blue2 extends Color2 6 public String getRGB return bl

10、ue 7 和 4 个声明 public abstract String getRGB abstract String getRGB private abstract String getRGB protected abstract String getRGB 分别插入到第 2 行 有多少行可以编译 A 0 B 1 C 2 D 3 12 单选 1分 public class TestApp public static void main String args try String myname null if myname length 2 System out print 1 catch N

11、ullPointerException e System out print 2 精品文档 收集于网络 如有侵权请联系管理员删除 上述程序运行后的输出是哪项 A 1 B 12 C 21 D 2 13 单选 1分 public class TestApp public static void main String args try int i 0 int j 1 i System out println 1 catch Exception e System out print 3 finally System out print 4 上述程序运行后的输出是哪项 A 4 B 34 C 43 D

12、14 14 单选 1分 现有 1 class Birds 2 public static void main String args 3 try 4 throw new Exception 精品文档 收集于网络 如有侵权请联系管理员删除 5 catch Exception e 6 try 7 throw new Exception 8 catch Exception e2 System out print inner 9 System out print middle 10 11 System out print outer 12 13 结果为 A inner B inner outer C

13、middle outer D inner middle outer 15 单选 1分 现有 9 void topGo 10 try 11 middleGo 12 catch Exception e 13 System out print catch 14 15 16 void middleGo throws Exception 17 go 18 System out print late middle 19 精品文档 收集于网络 如有侵权请联系管理员删除 20 void go throws Exception 21 throw new Exception 22 如果调用 topGo 则结果为

14、A catch B late middle C late middle catch D catch late middle 16 单选 1分 现有 1 class Propeller2 2 public static void main String args add code here 3 new Propeller2 topGo 4 5 void topGo add code here 6 middleGo 7 8 void middleGo add code here 9 go System out println late middle 10 11 void go add code h

15、ere 12 throw new Exception 13 为使代码通过编译 需要在哪一行加入声明 throws Exception A 只在第 11行 B 只在第 8 行和第 11 行 C 在第 5 行 第 8 行和第 11行 精品文档 收集于网络 如有侵权请联系管理员删除 D 在第 2 行 第 5 行 第 8 行和第 11 行 17 单选 1分 针对 Set String s接口 下列哪项是正确的 A s add 2 B s add new Integer 2 C s add 2 D s add new java util Date 18 单选 1分 BufferedWriter 对象中的

16、 newLine 方法的含义是哪项 A 产生换行 B 插入一个空行 C 产生回车 D 以上都不对 19 单选 1分 现有 f 对一个 java io File 型实例的合法引用 fr 对一个 java io FileReader 型实例的合法引用 br 对一个 java io BufferedReader 型实例的合法引用和 34 String line null 35 36 insert code here 37 System out println line 38 哪一行代码插入到36 行将循环通过一个文本文件并在文本域中每次输出一行 A while line f read null B while line fr read null C while line br read null D while line br readLine null 20 单选 1分 现有 精品文档 收集于网络 如有侵权请联系管理员删除 1 class Dog implements Serializable 2 Collar c new Collar 3 4 class Collar implement

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号