java面向对象程序设计试题一答案

上传人:xins****2008 文档编号:103920794 上传时间:2019-10-08 格式:DOC 页数:56 大小:82KB
返回 下载 相关 举报
java面向对象程序设计试题一答案_第1页
第1页 / 共56页
java面向对象程序设计试题一答案_第2页
第2页 / 共56页
java面向对象程序设计试题一答案_第3页
第3页 / 共56页
java面向对象程序设计试题一答案_第4页
第4页 / 共56页
java面向对象程序设计试题一答案_第5页
第5页 / 共56页
点击查看更多>>
资源描述

《java面向对象程序设计试题一答案》由会员分享,可在线阅读,更多相关《java面向对象程序设计试题一答案(56页珍藏版)》请在金锄头文库上搜索。

1、Java面向对象程序设计试题一答案一、单项选择题:选择第1题:B选择第2题:A选择第3题:C选择第4题:B选择第5题:A选择第6题:A选择第7题:B选择第8题:C选择第9题:B选择第10题:B二、多项选择题多项选择第1题:AB多项选择第2题:BD多项选择第3题:AD多项选择第4题:AD多项选择第5题:BCD多项选择第6题:AB多项选择第7题:ABCD多项选择第8题:ABCD多项选择第9题:BC多项选择第10题:BC三、 填空题答案 填空第1题:x=10,a=3,b=4,c=5填空第2题:java.util填空第3题:(public )(static )(void)(main)(String a

2、rgs)填空第4题:1填空第5题:26 四、 编程题答案1public class HelloWorldpublic static void main(String args)System.out.println(Hello,World!);import java.awt.Graphics;import java.applet.Applet;public class HelloWorld extends AppletString s;public void init()s=Hello World!;public void paint(Graphics g)g.drawString(s,25,2

3、5);2class yanghuipublic static void main (String args)int i,j;int yhlevel=10;int yanghui;System.out.println(杨晖三角形:);yanghui=new intyhlevel;for(i=0;iyanghui.length;i+)yanghuii=new inti+1;yanghui00=1;for (i=1; iyanghui.length;i+)yanghuii0=1;for(j=1;jyanghuii.length-1;j+)yanghuiij=yanghuii-1j-1+yanghui

4、i-1j;yanghuiiyanghuii.length-1=1;for (i=0; iyanghui.length;i+)for(j=0;jyanghuii.length;j+)System.out.print(yanghuiij+ );System.out.println(); 输出结果是:杨晖三角形:1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 13import java.io

5、.*;public class MemoControllerFileOutputStream fos;OutputStreamWriter osw;BufferedWriter bw;public MemoController()tryfos=new FileOutputStream(memo.txt,true); osw=new OutputStreamWriter(fos);bw=new BufferedWriter(osw);catch(FileNotFoundException e);public synchronized void append(String s)trybw.writ

6、e(s,0,s.length(); bw.flush();bw.close();osw.close();fos.close();catch(IOException e)public static void main(String args)MemoController mmc=new MemoController();mmc.append(I am xubin );4import java.io.*; class Phones static FileOutputStream fos;public static final int lineLength = 81;public static vo

7、id main(String args) throws IOExceptionbyte phone = new bytelineLength;byte name = new bytelineLength;int I;try fos = new FileOutputStream(phone.numbers);catch(FileNotFoundException e) while (true)System.err.println(Enter a name (enter done to quit);readLine(name);if (done.equalsIgnoreCase(new Strin

8、g(name,0,0,4)break; System.err.println(Enter the phone number); readLine(phone);for (int i=0;phonei!= 0;i+) fos.write(phonei);fos.write(,);for (int i=0;namei!= 0;i+)fos.write(namei); fos.write(n);fos.close(); private static void readLine(byte line) throws IOException int i=0,b=0; while (ilineLength-

9、1)&(b=System.in.read()!=n)linei+ = (byte)b; linei=(byte) 0; 5、import java.util.*;import java.text.*; class ThreeTimeThread extends Threadpublic ThreeTimeThread(String str) super(str);public void run() while (true) SimpleDateFormat formatter = new SimpleDateFormat (yyyy.MM.dd G at hh:mm:ss z);Date cu

10、rrentTime = new Date();try sleep(1000);catch (Exception e) String dateString = formatter.format(currentTime);System.out.println(getName()+:+dateString); public static void main(String args) throws Exceptionnew ThreeTimeThread(first).start(); new ThreeTimeThread(second).start();new ThreeTimeThread(th

11、ird).start(); -最新精品资料推荐-提供全程指导服务-上文已完。下文为附加公文范文,如不需要,下载后可以编辑删除,谢谢! 卫计委家庭发展科科长竞聘演讲稿尊敬的各位领导,各位同仁: 非常感谢委党委给我这次机会,站到这里来竞聘家庭发展科科长的职位,我想这是对我过去工作的的肯定,也是对我未来工作的期望,我会好好珍惜这次机会。今年是我从事人口计生工作的第七个年头,想想当年,初来乍到,面对各种业务术语真是一头雾水,听到专业名词看到一些药具还会脸红,就这样我成为了一名计生战线的新兵,一干就是七年。这一路走来,在领导、同志们的关心帮助之下,通过自己的不断学习努力,我不但逐渐的熟悉了业务,也对这份

12、工作产生了感情,同时也收获了领导和同志们的好评。从事计划生育工作以来,我一直负责宣传教育工作,主要包括新闻宣传、幸福家庭建设、出生人口性别比综合治理等工作。我真的很喜欢这些工作,虽然我不是学的这个专业,但兴趣是最好的老师,我去钻研、去请教、多学多看多写,自加压力,自我督促,从宣教工作的门外汉成为业务能手。而过去宣教工作中的两项内容幸福家庭建设、性别比治理现划归家庭发展科,再加上利益导向组成了现在的家庭发展科全部工作内容。其中两项工作都是我所从事数年、经验丰富且受到好评的,因此,我认为,我担任家庭发展科科长职务是有优势的。一是我有较强的写作能力,我先后在中国人口报、徐州日报等媒体上发表千字以上文章5篇,这有助于我区家庭发展工作经验、做法的总结、提炼、推广;二是我对组织大型活动有丰富经验,我连续三年参与了区“家庭人口文化节”的策划与实施工作。三是我对两非案件的查处经验丰富,从联合执法现场查处到案件文书制作、卷宗整理归档,到国家两非系统的案卷录入、系统维护,整个流程我都非常熟悉,自从两非纳入全市科学发展考核目标以来,我区的打击两非工作始终走在主城区最前列,并被列为加分项目。以上这些都是我在本职工作中任劳任怨、勤学肯干的一些积累和经

展开阅读全文
相关资源
相关搜索

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

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