《2012年1月全国自考Java语言程序设计(一)试题及答案.pdf》由会员分享,可在线阅读,更多相关《2012年1月全国自考Java语言程序设计(一)试题及答案.pdf(12页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、1/12 封面2/12 作者:PanHongliang 仅供个人学习全国 2012年1月高等教育自学考试Java 语言程序设计(一)试卷及答案课程代码:04747 一、单项选择题(本大题共10 小题,每小题1 分,共 l0 分)1.下面供选字符序列中,不属于Java语言关键字的是(A.inner B.throw C.false 2.表达式“-11”的十进制值是(B)C)D.throws B.2 311 A.2 C.(2 311)D.2 321 3.Java语言中,在类定义时用final关键字修饰,是指这个类(D)A.子类必须实现父类未实现的方法C.必须要有实例4.表达式 java程序设计.1e
2、ngth()的值是(C)A.0 B.12 C.8 B.没有具体实现代码D.不能被继承D.13 5.以下关于 BorderLayout布局的叙述中,不正确的是(D)A.把容器内的空间划分成5个区域C.是框架窗口的默认布局B.加入组件应该指明要放入的区域D.一个位置可直接放多个组件6.利用文件对话框打开或保存文件,在打开文件对话框之前,可用FileFilter 类设置筛选条件,其所用的两个方法是(B)A.accept()和getSelectedFile()C.accept()和setDescription()B.accept()和getDescription()D.setDescription()
3、和getDescription()7.设已经有 Graphics2D对象g2d,RoundRectangle2D对象rRect,绘制对象 rRect的代码是(A.g2d.draw(rRect)B.g2d.drawRoundRect(rRect)C.rRect.draw()D.rRect.drawRoundRect()8.以下关于线程互斥和同步的叙述中,正确的是(A)A.临界段是线程互斥使用资源的程序段B.临界段能使线程使用其它线程的资源C.互斥和同步能很好地解决死锁问题D.可用notify()方法让等待线程结束等待9.在编写访问数据库的 Java程序时,Connection对象的作用是(C)A
4、.存储查询结果 B.在指定的连接中处理 SQL语句C.用来表示与数据库的连接D.用来创建数据库的连接10.获取InetAddress对象的域名所用到的方法是(A)A)A.getHostName()B.getLocalName()C.getHostAddress()D.getLocalHost()二、填空题(本大题共10 小题,每空2 分,共 20 分)11.能在浏览器上执行的 Java程序被称为 _小应用程序 Applet_。12.如果子类 A隐藏了超类 B的成员变量 x,而类 A的某个方法 f()要引用类 B的x,则引用类 B的x的引用代码可以写成 _super:x_。13.接口有与类相似的
5、基本形式,它有常量定义和方法定义,但没有_方法的实现代码 _。14.设u和v是类 A的两个对象,15.要获得对象的字符串表示,调用的方法是_toString()_。16.注册鼠标点击事件监视器的方法是_addMouseListener()_。17.在异或模式下绘图时,实际绘制的颜色是由当前正要绘制的颜色、原先绘制的颜色,以及_异或模式设定的颜色 _作特定的运算确定的。18.多线程程序设计中,让执行临界段程序时等待的线程结束等待,通常使用的方法有resume()、notify()或者_ notifyAll()_。19.创建的流既可以随机输出,也可以随机输入的类是_RandomAccessFile
6、_。20.Java 程序中使用套接字方法实现C/S模式时,Client端支持网络底层通讯的类是_Socket_。2012年1月自学考试 Java语言程序设计(一)试卷及答案1 文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM
7、8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1
8、N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2
9、C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:
10、CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 H
11、O1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 Z
12、O2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O33/12 三、简答题(本大题共6 小题,每小题3 分,共18 分)21.请写出以下程序段
13、的执行结果。int c=0,d,n=3758;if(d=n l0)c)while(n0)System.out.println(结果=+c);c=d;n/10;这题的循环变量 n无改变循环无法终止,可能有误,找不到试卷的扫描文件,没做。22.什么是方法重载,如何正确区分重载?方法重载是指,一个类中可以有多个方法具有相同的名字和类型,但这些方法的参数必须不同,或者是参数个数不同,或者是参数类型不同。23.请写出定义一个包含 2个子数组的二维整型数组对象aArr的代码,二个子数组有 3个元素。int aArr=new int2。aArr0=new int5。aArr1=new int3。24.请写出
14、创建一个 JPanel对象 p,并为对象 p设定 GridLayout布局的代码。JPanel p=new JPanel()。p.setLayout(new GridLayout)。25.由于创建输出流对象时,可能会出现IOException异常,所以创建输出流对象的代码必须出现在try-catch语句结构中。请写出为当前目录下的myFile.dat文件创建缓冲输出流对象outs的代码。try FileWriter writefile=new FileWriter(“myFile.dat”)。BufferedWriter outs=new BufferedWriter(writefile)。c
15、atch(IOExceptio e)26.请写出已知数据库 url、用户名 uName和密码 pWord,通过驱动程序管理器(DriverManager)的方法getConnection()建立连接 con的代码,可能产生的异常是SQLException。try con=DriverManager.getConnection(url,uName,pWord)。catch(SQLException e)e.printStackTrace()。return return con。null。四、程序填空题(本大题共5 小题,每空2 分,共20 分)27.方法int tenDigNumlnArray(
16、int a,int d)的功能是统计数组中十位数是d的整数的个数。提示:对于一个整数n,运算 n/10的作用是求得去掉 n的个位数后的整数,运算n10的作用是求得 n的个位数。static int tenDigNumlnArray(int a,int d)int c=0;for(int i=0;_ia.length_;i+)if(_ai/10=d_)c+;return c;2012年1月自学考试 Java语言程序设计(一)试卷及答案2 文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1
17、O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q
18、8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N1
19、0L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1
20、E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O
21、5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2
22、N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2
23、M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O34/12 28.某小应用程序的类实现了接口ActionListener,在其窗口有一个文本区对象text和一个标上文字“输入一个整数”的按钮对象,并正确为该按钮对象注册了监视器。按钮处理程序要实现的功能是当点击这个按钮时,程序弹出一个输入信息的对话框,输入一个整数n,程序接受 n后,将 2至n的所有偶数输出在文本区 text中。以下是其中处理按钮事件的方法。public void actionPerformed(Acti
24、onEvent e)if(e._getActionCommand_.equals(输入一个整数)String res=(String)JOptionPane.showInputDialog(null,输入一个正整数,输入对话框,JOptionPane.PLAIN_MESSAGE,null,null,null);n=Integer.parseInt(res);text.setText();.for(int k=2;k=n;k+=2)text._setText(k+)_;29.一个示意选择框选择的类CheckBoxWin,类的构造方法根据给定的选择工程表构造一组选择框,这组选择框允许多选,当这组选
25、择框中的某个选择项的选择状态有改变(从选中变成未选中,或从未选中变成选中)时,选择框的监视程序在一个文本区中输出那个状态有改变的选择工程。以下是类CheckBoxWin的定义。class CheckBoxWin extends JFrame implements ItemListener JPanel p=new JPanel();JTextArea text;StringnameList;JCheckBox boxArray;CheckBoxWin(Stringsp)Container con=getContentPane();con.setBackground(Color.BLUE);co
26、n.setLayout(new FlowLayout();p.setSize(90,(sp.1ength)*20);p.setLayout(new GridLayout(sp.1ength,1);nameList=sp;boxArray=new JCheckB oxsp.1ength;for(int i=0;inameList.1ength;i+)JCheckBox box=new JCheckBox(spi);box._addItemListener(this)_。p.add(box);boxArrayi=box;con.add(p);text=new JTextArea(3,13);tex
27、t.setText();JScrollPane jsp=new JScrollPane(text);jsp.setSize(100,60);con.add(jsp);setSize(100,(sp.1ength)*20+120);setLocation(100,100);2012年1月自学考试 Java语言程序设计(一)试卷及答案3 文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O
28、5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2
29、N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2
30、M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM
31、8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1
32、N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2
33、C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:
34、CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O35/12 setVisible(true);public void itemStateChanged(ItemEvent e)for(int i=0;i=KeyEvent.VK_A&t=KeyEvent.VK_Z)text.append(+(char)t);五、程序分析题(本大题共5 小题,每小题4 分,共20 分)32.阅读下列程序,请写出该程序的功能。public class Test32 2012年1月自学考试Java语言程序设计(一)试卷及答案4文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2
35、M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM
36、8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1
37、N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2
38、C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:
39、CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 H
40、O1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 Z
41、O2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O36/12 args)sum=0.0;(int i=1;for i=500;i+)sum+=1.0/(double)i;System.out.println(sum=+sum);111 1 程序功能:计算并显示sum=1 2 3 50033.阅读下列程序,请回答以下问题:(1)界面中有哪些组件?(2)点击每一个按钮分别会显示什么内容?
42、import java.applet.*;import java.awt.*;import java.awt,event.*;import javax.swing.*。public class Test33 extends Applet implements ActionListener String msg=;String buttonCom=Yes,No,Undecided;JButton bList=new JButtonbuttonCom.length;JTeXtField t;public void init()setLayout(new GridLayout(4,1);for(in
43、t i=0;ibuttonCom.1ength;i+)bListi=new JButton(按钮+(i+1);add(bListi);bListi.addActionListener(this);t=new JTextField();add(t);public void actionPerformed(ActionEvent e)for(int i=0;i3;i+)if(e.getSource()=bListi)t.setTeXt(You pressed+buttonComi);break;答:(1)界面中组件有;三个按钮,一个文本框。(2)分别显示:You pressed Yes;You p
44、ressed No;You pressed Undecided。34.阅读下列程序,请写出该程序的功能。import java.io.*;import java.awt.*;import javax.swing.*;import java.awt.event.*;class MyWindow extends JFrame implements ActionListener JTextArea text;BufferedReader in;JTextField fileName;FileReader file;2012年1月自学考试 Java语言程序设计(一)试卷及答案5 文档编码:CM8O5Q
45、8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N1
46、0L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1
47、E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O
48、5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2
49、N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2
50、M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM8O5Q8K1U4 HO1N2N10L6U8 ZO2C2M1E1O3文档编码:CM