【计算机类职业资格】二级JAVA机试-130及答案解析.doc

上传人:roleaisle130 文档编号:1326460 上传时间:2019-10-17 格式:DOC 页数:3 大小:33.50KB
下载 相关 举报
【计算机类职业资格】二级JAVA机试-130及答案解析.doc_第1页
第1页 / 共3页
【计算机类职业资格】二级JAVA机试-130及答案解析.doc_第2页
第2页 / 共3页
【计算机类职业资格】二级JAVA机试-130及答案解析.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、二级 JAVA 机试-130 及答案解析(总分:100.00,做题时间:90 分钟)一、1基本操作题(总题数:1,分数:30.00)1.System.out.println(String.valueOf(stringname._);(分数:30.00)_二、2简单应用题(总题数:1,分数:40.00)2.“);(分数:40.00)_三、3综合应用题(总题数:1,分数:30.00)3.下面的 Applet 程序通过内部类处理鼠标单击事件。在小程序中,如果点击鼠标,则在状态栏输出鼠标点击的坐标;如果双击鼠标,则显示一副图片,鼠标单击处为显示图片的左上角坐标,显示图片的宽度为200 像素,高度为 1

2、80 像素。请改正程序中的错误(有下划线的语句),使程序执行后,能得到预期的结果。注意:不改动程序的结构,不得增行或删行。程序的执行结果为:(分数:30.00)_二级 JAVA 机试-130 答案解析(总分:100.00,做题时间:90 分钟)一、1基本操作题(总题数:1,分数:30.00)1.System.out.println(String.valueOf(stringname._);(分数:30.00)_正确答案:(Stringstringnamelength()-1;charAt(i)解析:解析本题主要考查 for 循环语句和字符串 String 类的基本操作。解答本题的关键是熟练掌握

3、 for 循环语句和字符串 String 类的基本操作的知识。在 Java 语言中,字符串是作为对象出现的,由javalangString 和 javalangStringBuffer 定义,分别用来处理长度不变和长度可变字符串,这两个类都被定义为 final,即参考数据类型。String 类中 length()用于计算字符串的长度, charAt()方法用于获得字符串某一位置的字符。二、2简单应用题(总题数:1,分数:40.00)2.“);(分数:40.00)_正确答案:(jn-i;aj=aj+1;)解析:解析本题主要考查 for 循环语句的用法及数组的基本知识。解答本题的关键是能够熟练的掌

4、握冒泡排序算法的思想及 for 循环语句的用法。排序是数据处理中经常使用的一种重要运算。常见排序分为:插入排序,选择排序,冒泡排序,基数排序等等。在本题中,for(j=0;jn-i;j+)循环的功能是对上次排序的结果再进行排序从中选择处最小的数。aj=aj+1;语句的功能是把最小的数放在数组的最前面。三、3综合应用题(总题数:1,分数:30.00)3.下面的 Applet 程序通过内部类处理鼠标单击事件。在小程序中,如果点击鼠标,则在状态栏输出鼠标点击的坐标;如果双击鼠标,则显示一副图片,鼠标单击处为显示图片的左上角坐标,显示图片的宽度为200 像素,高度为 180 像素。请改正程序中的错误(

5、有下划线的语句),使程序执行后,能得到预期的结果。注意:不改动程序的结构,不得增行或删行。程序的执行结果为:(分数:30.00)_正确答案:(drawImage(pic,xPos,yPos,200,180,this);pic=getImage(getDocumentBase(),“huajpg“);repaint();)解析:解析本题主要考查 Applet 小程序的应用。解答本题的关键是能够熟练掌握 Applet 小程序的基本理论及其执行过程。在本题中,通过内部类 ClickMouse 处理鼠标单击事件。gdrawImage(pic,xPos,yPos,200,180,this);语句的功能是在指定的 Applet 显示区内画出图片,pic=getImage(getDocumentBase(),“hua.jpg“);语句功能是获取图片的 URL,repaint();语句功能是重新显示图片。

展开阅读全文
相关资源
猜你喜欢
  • JIS B 8397-1-2008 6250 Hydraulic fluid power -- Determination of characteristics of motors -- Part 1 At constant low speed and constant pressure《液压传动 马达特性的测定 第1.pdf JIS B 8397-1-2008 6250 Hydraulic fluid power -- Determination of characteristics of motors -- Part 1 At constant low speed and constant pressure《液压传动 马达特性的测定 第1.pdf
  • JIS B 8397-2-2008 6250 Hydraulic fluid power -- Determination of characteristics of motors -- Part 2 Startability《液压传动 马达特性的测定 第2部分 起动性》.pdf JIS B 8397-2-2008 6250 Hydraulic fluid power -- Determination of characteristics of motors -- Part 2 Startability《液压传动 马达特性的测定 第2部分 起动性》.pdf
  • JIS B 8397-2002 Hydraulic fluid power -- Gas-loaded accumulators with separator -- Ranges of pressures and volumes and characteristic quantities《液压流体动力 带分离器的气-液.pdf JIS B 8397-2002 Hydraulic fluid power -- Gas-loaded accumulators with separator -- Ranges of pressures and volumes and characteristic quantities《液压流体动力 带分离器的气-液.pdf
  • JIS B 8397-3-2001 Hydraulic fluid power -- Determination of characteristics of motors -- Part 3 At constant flow and at constant torque《液压流体动力 电动机特性的测定 第3部分 在恒定.pdf JIS B 8397-3-2001 Hydraulic fluid power -- Determination of characteristics of motors -- Part 3 At constant flow and at constant torque《液压流体动力 电动机特性的测定 第3部分 在恒定.pdf
  • JIS B 8398-2002 Hydraulic fluid power -- Gas-loaded accumulators -- Dimensions of gas ports《液压流体动力 气-液蓄压器 气体口的尺寸》.pdf JIS B 8398-2002 Hydraulic fluid power -- Gas-loaded accumulators -- Dimensions of gas ports《液压流体动力 气-液蓄压器 气体口的尺寸》.pdf
  • JIS B 8399-2002 Hydraulic fluid power -- Gas-loaded accumulators with separator -- Selection of preferred hydraulic ports《液压流体动力 带分离器的气-液蓄压器 优选液压端口的选择》.pdf JIS B 8399-2002 Hydraulic fluid power -- Gas-loaded accumulators with separator -- Selection of preferred hydraulic ports《液压流体动力 带分离器的气-液蓄压器 优选液压端口的选择》.pdf
  • JIS B 8403-1-2013 9375 Pneumatic fluid power -- Mounting dimensions for accessories -- Part 1 Rod end spherical eyes 1MPa series《气压流体动力 附件的安装尺寸 第1部分 1 MPa系列杆端球形.pdf JIS B 8403-1-2013 9375 Pneumatic fluid power -- Mounting dimensions for accessories -- Part 1 Rod end spherical eyes 1MPa series《气压流体动力 附件的安装尺寸 第1部分 1 MPa系列杆端球形.pdf
  • JIS B 8403-2-2013 6875 Pneumatic fluid power -- Mounting dimensions for accessories -- Part 2 Rod end clevis 1MPa series《气压传动 附件安装尺寸 第2部分 1 MPa系列杆端挂钩》.pdf JIS B 8403-2-2013 6875 Pneumatic fluid power -- Mounting dimensions for accessories -- Part 2 Rod end clevis 1MPa series《气压传动 附件安装尺寸 第2部分 1 MPa系列杆端挂钩》.pdf
  • JIS B 8404-3-2010 9375 Hydraulic fluid power -- Mounting dimensions for accessories -- Part 3 Round cover type cylinders 16 MPa and 25 MPa series《液压传动 附件安装尺寸 第3.pdf JIS B 8404-3-2010 9375 Hydraulic fluid power -- Mounting dimensions for accessories -- Part 3 Round cover type cylinders 16 MPa and 25 MPa series《液压传动 附件安装尺寸 第3.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1