已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1 徐州师范大学徐州师范大学试试卷卷 2011 2012 学年度第学年度第 一一学期 学期 考试日期 2011 年 9 月 21 日 课程名称 Core Java 开发技术及实践 试卷类型 开卷 学院 计算机学院 专 业 软件工程 班级 09 计 71 学号 姓名 成绩 一 统计 请不要在此填写任何信息 交卷排名区 速度得分 客观得分 总分 二 考试说明 1 此试卷是本科目考试的基础知识部分 此部分占最终考试成绩的 30 2 此试卷总分 300 分 分为两个部分 客观得分部分占 252 分 约占 85 根据答题正确性得 出 速度得分部分占 48 分 约占 15 根据答题交卷时间的先后顺序得出 3 客观得分部分 共有 21 道选择题 每道选择题占 12 分 4 速度得分部分 提交试卷时 收卷老师会根据你的交卷时间登记你的排名 第一名的速度得 分部分将获得 48 分 第二名的速度得分部分将获得 47 分 之后依次类推 不交卷 交白 卷 无论提交时间先后 速度得分部分均为 0 分 三 答题卡 1 2 3 4 5 6 7 8 9 10 填写区 11 12 13 14 15 16 17 18 19 20 21 填写区 2 四 选择题 每题 12 分 共 252 分 1 下列表达式正确的是 2 下列不可以作为 java 变量名或方法名的是 3 当通过 03 行调用 switchIt 方法时 代码是如何运行的 4 下面程序的输出结果是 5 执行完以下代码 int x new int 2 后 下列各项正确的是 A byte bv 129 B boolean isTure null C long id 1963623338L D float PI 3 1415926 A xuZhou B 3xuZhou C xuZhou D xuZhou 01 public class SwitchTest 02 public static void main String args 03 System out println value switchIt 4 04 05 public static int switchIt int x 06 int j 1 07 switch x 08 case 1 j 09 case 3 j 10 case 2 j 11 case 5 j 12 case 4 j 13 default j 14 15 return j x 16 17 A 06 07 12 15 B 06 07 12 11 15 C 06 07 12 13 15 D 06 07 12 11 13 15 public static void main String args int d 325 int sum 0 while d 0 int n d 10 sum n d 10 System out println sum A 5 B 10 C 12 D 32 A x 0 为null B x 1 为0 C x 1 为undefined D x 2 为0 3 6 小扎同学实现对数组arry的冒泡升序排序 但是小挖同学搅乱了他的代码 请帮小扎同学将代码恢复原状 7 如果 Son 类继承了 Father 类 那么在 Son 类不可以声明哪个方法 public void bubbleSort int arry int len arry length for int i 1 i i j if arry j i j if arry j i j if arry j arry j 1 swap arry j j 1 asc false D for int j len 1 j i j if arry j arry j 1 swap arry j j 1 asc true public class Father protected int hi int a int b return 0 A public int hi int a int b return 0 B protected void hi int a int b C protected int ha int a int b return 0 D protected int hi int a return 1 4 8 以下代码的执行结果是 9 以下说法正确的是 Animal java public class Animal public void eat System out println 动物在吃 Human java public class Human extends Animal public void eat System out println 人在吃 Driver java public class Driver public static void main String args Human human new Human Animal animal human human eat A 动物在吃 B 人在吃 C 动物在吃 人在吃 D 人在吃 动物在吃 A 声明final的类不能被继承 B 声明final的类可以被继承 C 没有声明final的类不可以被继承 D 没有声明final的类不可以被new 5 10 在注释的地方插入代码会导致编译或运行错误的是 Calculable java public interface Calculable public int calculate String expression Human java public class Human implements Calculable public int calculate String expression return 0 Computer java public class Computer implements Calculable public int calculate String expression return 0 MagicPower java public interface MagicPower public void conjure String incantation Wizard java public class Wizard extends Human implements MagicPower public int calculate String expression return 0 public void conjure String incantation Driver java public class Driver public static void main String args Wizard wizard new Wizard Human human new Human Object obj new Object Calculable cal new Computer 插入代码 A obj cal B human wizard C wizard Wizard human MagicPower mp wizard mp conjure 阿瓦达锁命 D MagicPower mp wizard obj mp 6 11 如果控制台的输出结果是 false true 那么注释处填入的代码正确的是 Human java public class Human private String name public Human name unknown public Human String name this name name public String getName return name 插入代码 Driver java public class Driver public static void main String args Human h1 new Human new String tom Human h2 new Human tom System out print h1 h2 System out println h1 equals h2 A public boolean equals Object obj if obj instanceof Human Human human Human obj return human getName this name else return false B public boolean equals Object obj if obj instanceof Human Human stu Human obj return human getName equals this name else return false C public boolean equals Object obj if obj instanceof Student return obj name equals this name else return false D public boolean equals Object obj if obj instanceof Human return obj getName this name else return false 7 12 指出下列程序运行的结果 13 下面的代码用于输出字符数组 ch 中每个字符出现的次数 应该填入的代码是 public class Example public String str new String good public char ch a b c public void change String str char ch str test ok ch 0 g public static void main String args Example ex new Example ex change ex str ex ch System out print ex str and System out print ex ch A good and abc B good and gbc C test ok and abc D test ok and gbc Driver java public class Driver public static void main String args char ch a c a b c b HashMap map new HashMap for int i 0 i ch length i 填入代码 System out println map A if map contains ch i map put ch i map get ch i 1 else map put ch i 1 B if map contains ch i map put ch i Integer map get ch i 1 else map put ch i 1 C if map containsKey ch i map put ch i int map get ch i 1 else map put ch i 1 D if map containsKey ch i map put ch i Integer map get ch i 1 else map put ch i 1 8 14 题示代码的功能为 对于一个存放 Integer 对象的 ArrayList 内容为 1 2 3 对其进行循环遍历 那么插入代码 1 和插入代码 2 处的代码分别为 15 对于一个存放 Human 对象的 ArrayList 进行循环遍历 应该在注释的地方插入的代码是 16 题目代码的功能是 采用Iterator进行循环遍历到集合中的每一个元素 并将其移除 插入代码 处应填入的代码是 List list new ArrayList list add 1 list add 2 list add 3 for int i 0 i 插入代码1 i Integer obj Integer 插入代码2 System out println obj A list getObject i list length B list length list getObject i C list size list get i D list get i list size public void print List list for 这里要插入的代码 一些代码 A Person person list B Person person List C List list Person D List list person ArrayList list new ArrayList list add java list add php list add net 插入代码 A Iterator it list iterator while it hasNext it next it remove B Iterator it list iterator while it hasNext it remove C Iterator it list iterator while it hasNext Object obj it next list remove obj D Iterator it list iterator while it hasNext list remove 9 17 题示代码的功能为 循环遍历输出 Map 当中的每一个元素 那么在插入代码处应该依次插入哪些代码 18 下列代码的运行结果是 表示空白 19 阅读下面程序段 假设 file dat 不存在 运行该程序段后 文件 file dat 的字节数为 Map map new HashMap map put jessica 100 map put tom 200 map put den 300 Set 插入代码1 set 插入代码2 for 插入代码3 per set System out println per getKey per getValue A map keySet Entry B map entrySet Entry C Map Entry map keySet Map Entry D Map Entry map entrySet Map Entry public class Base private void test String aStr One String bStr aStr bStr aStr trim System out println aStr bStr static public void main String a new Base test A One One B One One C One One D One One BufferedOutputStream bos new BufferedOutputStream new FileOutputStream file dat bos write 100 A 0 B 1 C 2 D 3 10 20 题目代码的功能为 在 d 创建一个文件 test txt 并向文件输入 HelloWorld 然后删除文件 请在注释区填入正确的 代码 21 Which one is the possible result public static void main String args File file new File d file txt try catch Exception e e printStackTrace A BufferedWriter bw new BufferedWriter new FileWriter file bw write HelloWorld bw close if file exists file delete B Buffer
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 自制水囊在剖宫产宫缩乏力出血中的临床应用
- 应急响应的统一指挥
- 二零二五年度道路设施更新改造合同3篇
- 二零二五年度个人乡村旅游消费贷款合同示范文本2篇
- 二零二五年度屋顶防水隔热节能改造合同4篇
- 2025年度新能源储能系统采购与安装合同范本3篇
- 2025版高层建筑消防系统改造合同协议书3篇
- 二零二五年度个人股权代持与公司解散合同3篇
- 不良反应上报流程
- 二零二五年度大学生创业项目融资借款合同
- 2025届安徽省皖南八校联盟高二物理第一学期期末统考试题含解析
- 第六章-主成分分析法
- 2024简单的租房合同样本下载
- 中考数学计算题练习100道(2024年中考真题)
- 新人教版五年级上册数学应用题大全及答案
- 【家庭教育】0-3岁婴幼儿早教训练方案
- 国家中长期科技发展规划(2021-2035)
- 经营范围登记规范表述目录(试行)(V1.0.2版)
- 2023年山东省威海市中考物理真题(附答案详解)
- 第八讲 发展全过程人民民主PPT习概论2023优化版教学课件
- 王崧舟:学习任务群与课堂教学变革 2022版新课程标准解读解析资料 57
评论
0/150
提交评论