当前位置:文档之家› 04747Java语言程序设计(一)历年真题6

04747Java语言程序设计(一)历年真题6

04747Java语言程序设计(一)历年真题6
04747Java语言程序设计(一)历年真题6

2011年10月高等教育自学考试全国统一命题考试

Java语言程序设计(一)试卷

(课程代码 04147)

一、单项选择题(本大题共10小题,每小题1分,共10分)

在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。

1.下面供选字符序列中,不属于

...Java语言关键字的是【】

A.throw B.synchronized

C.protect D.try

2.以下程序代码的输出的结果是【】

double X=25.6:

System.out.println((int)x<<1);

A.48 B.50

C.5l D.52

3.在以下供选择的概念中,不属于

...面向对象语言概念的是【】

A.类 B.函数

C.动态联编 D.抽象

4.在Java语言中,能够实现字符串连接的方法是【】

A.String substring(int startpoint) B.String concat(String S)

C.String replace(char old,char new) D.String trim()

5.在以下供选择的容器类中,属于顶层容器的是【】

A.JDialog B.JPanel

C.JScrollPane D.JToolBar

6.在以下选项中,属于MouseListener接口的方法是【】

A.mouseDoubleClicked(MouseEvent) B.mouseDragged(MouseEvent)

C.mouseMoved(MouseEvenf) D.mousePressed(MouseEvent)

7.设已经有Graphics2D对象g2d,Line2D对象line,绘制对象line的代码是【】 A.g2d.draw(1ine) B.g2d.drawLine(1ine)

C.1ine.draw() D.1ine.drawLine()

8.设Thread对象thd的优先级为7,thd又创建了另一个thread对象chd,如果未对chd的优先级进行修改,则chd的优先级为【】

A.1 B.5

C.7 D.10

9.在以下供选择的操作中, File对象能够提供的操作是【】

A.删除文件 B.读写文件

C.打开文件 D.查询文件属性

1O.在编写访问数据库的Java程序时, Statement对象的作用是【】

A.建立新数据库连接 B.设置查询命令

C.创建SQL,语句对象 D.存储查询结果

二、填空题(本大题共10小题,每小题2分,共20分)

请在每小题的空格中填上正确答案。错填、不填均无分。

11.Java语言是一种语言,它约束程序员必须遵守规定编写程序,能让编译器检测出程序中尽可能多的错误。

12.在Java语言中,语句用于表示出现在该文件中的所有类都属于这个程序包。13.在Java程序系统中,对象之间的交互通过相互发送实现。

l4.数组每个元素按存储顺序对应一个下标,下标从开始顺序编号。

15.用Swing编写GUI程序时,通常用类派生的子类创建窗口对象。

l6.强制型对话框强制对话过程,直至对话过程结束,才让程序响应对话框以外的事件。

17.在Graphics类中,用于在指定的位置显示字符串的方法是。

18.在Java中,线程的调度策略采用,优先级高的线程比优先级低的优先执行。

19.字符流数据中使用的Unicode字符有位二进制位。

20.java.net包中有类,它的对象用于存储IP地址和域名。

三、简答题(本大题共6小题,每小题3分,共18分)

21.请使用for循环语句实现计算的值。

22.请写出Java语言中编写事件处理程序的两种方案。

23.请写出代码段,用来创建一个标签对象1b1,显示文字为“Java”,背景色设为绿色。24.请写出JComboBox对象上可能发生的两种事件类型的名字。

25.请写出线程从阻塞状态恢复到就绪状态的三种途径。

26.请写出URLConnection类提供的获得输入输出流对象的方法和实现网络连接的方法。

四、程序填空题(本大题共5小题,每空2分,共20分)

27.方法void moveOddForward(int a[])的功能是将数组中的所有奇数移到所有偶数之前。

void moveOddForward(int a[]){

for(int i=0,odd=0;;i++)

if( ){

int t=a[i];a[i]=a[odd];a[odd]=t;odd++;

}

}

28.以下程序片段定义由JFrame类派生的子类MyWindowDemo。类MyWindowDemo的构造方法有五个参数:窗口的标题名,加入窗口的按钮,按钮的背景颜色,以及窗口的宽和高。

29.小应用程序有一个按钮和一个文本区,按钮作为发生键盘事件的事件源,并对键盘

事件实施监视。程序运行时,先点击按钮,让按钮激活。以后输入英文字母时,在文本区显示输入的字母。

30.以下程序的界面有一个文本区text,一个按钮button。程序运行时,单击按钮,则将文本区中的内容输出到out,其中out为BufferWriter类的一个对象。

31.数据库连接方法connectByJdbcOdbc()按给定的数据库URL用户名和密码连接数据库,如果连接成功,方法返回连接对象,连接不成功,则返回空。

32.阅读下列程序,请写出该程序的输出结果。

33.阅读下列程序,请写出该程序的输出结果。

34.阅读下列程序,请写出该程序的功能。

35.阅读下列程序,请写出该程序的功能。

36.阅读下列程序,请写出该程序的输出结果。

注:假设处理机中没有其它线程占用资源。

六、程序设计题(本大题共2小题,每小题6分,共12分)

37.请编写一个方法int findMaximum(int[][]numbers),要求该方法返回二维数组中元素的最大值。

38.小应用程序的paint(Graphics g)方法能在屏幕窗口上显示信息和绘图,如果paint()方法能调用repaint()方法,这就能使显示实现动态效果,repaint()方法的功能是先清除paint()方法以前所画的内容,然后再调用paint()方法。

以下要你编写的paint()方法取随机的坐标位置画一个边长为20个像素的红色正方

形。其中随机的坐标位置可以用以下表达式表示:

(int)(Math.random()*100)+10

另要求paint()方法在绘制正方形后暂停100毫秒。

importjava.applet.*;importjava.awt.*;

public class Class 1 extends Applet{

public void paint(Graphics g){

//请在以下位置编写代码

索要答案请扫描二维码

04747java语言程序设计(一)20120年01月试卷

全国2012年1月高等教育自学考试 Java语言程序设计(一)试题 课程代码:04747 一、单项选择题(本大题共10小题,每小题1分,共l0分) 在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。 1.下面供选字符序列中,不属于 ...Java语言关键字的是( ) A.inner B.throw C.false D.throws 2.表达式“-1>>>1”的十进制值是( ) A.-2 B.231-1 C.-(231-1) D.232-1 3.Java语言中,在类定义时用final关键字修饰,是指这个类( ) A.子类必须实现父类未实现的方法 B.没有具体实现代码 C.必须要有实例 D.不能被继承 4.表达式"java程序设计".1ength()的值是( ) A. 0 B.12 C. 8 D.13 5.以下关于BorderLayout布局的叙述中,不正确 ...的是( ) A.把容器内的空间划分成5个区域 B.加入组件应该指明要放入的区域 C.是框架窗口的默认布局 D.一个位置可直接放多个组件 6.利用文件对话框打开或保存文件,在打开文件对话框之前,可用FileFilter类设置筛选条件,其所用的两个方法是( ) A.accept()和getSelectedFile() B.accept()和getDescription() C.accept()和setDescription() D.setDescription()和getDescription() 7.设已经有Graphics2D对象g2d,RoundRectangle2D对象rRect,绘制对象rRect的代码是( ) A.g2d.draw(rRect) B.g2d.drawRoundRect(rRect) C.rRect.draw() D.rRect.drawRoundRect() 8.以下关于线程互斥和同步的叙述中,正确的是( ) A.临界段是线程互斥使用资源的程序段 B.临界段能使线程使用其它线程的资源 浙04747# Java语言程序设计(一)试卷第1页(共12页)

英语六级真题及答案解析

20XX年6月大英语六级考试真题及答案解析 Part I Writing (30 minutes) Directions: For this part, you are allowed 30 minutes to write a short essay on living in the virtual world. Try to imagine what will happen when people spend more and more time in the virtual world instead of interacting in the real world. You are required to write at least 150 words but no more than 200 words. Part II Listening Comprehension (30 minutes) Section A Directions: In this section, you will hear two long conversations. At the end of each conversation, you will hear four questions. Both the conversation and the questions will be spoken only once. After you hear a question, you must choose the best answer from the four choices marked A),B),C)and D). Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre. Questions 1 to 4 are based on the conversation you have just heard. 1. A)Project organizer B)Public relations officer. C)Marketing manager. D)Market research consultant. 2.A)Quantitative advertising research. B)Questionnaire design. C)Research methodology. D)Interviewer training. 3.A)They are intensive studies of people’s spending habits. B)They examine relations between producers and customers. C)They look for new and effective ways to promote products. D)They study trends or customer satisfaction over a long period. 4.A)The lack of promotion opportunity. B)Checking charts and tables. C)Designing questionnaires. D)The persistent intensity. Questions 5 to 8 are based on the conversation you have just heard. 5.A)His view on Canadian universities. B)His understanding of higher education. C)His suggestions for improvements in higher education. D)His complaint about bureaucracy in American universities. 6.A)It is well designed. B)It is rather inflexible.

2019年6月大学英语六级考试真题(第2套)

2019年6 月大学英语六级考试真题(第2 套) Part I Writing (30 minutes) Directions: For this part, you are allowed 30 minutes to write an essay on the importance of mutual understanding and respect in interpersonal relationships. You should write at least 150 words but no more than 200 words. PartⅡListening Comprehension (30 minutes) Section A Directions: In this section, you will hear two long conversations. At the end of each conversation, you will hear four questions. Both the conversation and the questions will be spoken only once. After you hear a question, you must choose the best answer from the four choices marked,A)B),C) and D). Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre. Questions 1 to 4 are based on the conversation you have just heard. 1. A) A six- month-long negotiation. B) Preparations for the party. C) A project with a troublesome client. D) Gift wrapping for the colleagues. 2. A) Take wedding photos. B) Advertise her company. C) Start a small business. D) Throw a celebration party. 3. A) Hesitant. B) Nervous. C) Flattered. D) Surprised. 4. A) Start her own bakery. B) Improve her baking skill. C) Share her cooking experience. D) Prepare for the wedding. Questions 5 to 8 are based on the recording you have just heard. 5. A) They have to spend more time studying. B) They have to participate in club activities. C) They have to be more responsible for what they do. D) They have to choose a specific academic discipline. 6. A) Get ready for a career. B) Make a lot of friends.

Java语言程序设计课后习题答案

Java语言程序设计(郑莉) 第二章习题答案 1.什么是对象、类,它们之间的联系 答:1)对象是包含现实世界物体特征的抽象实体,它反映系统为之保存信息和与它交互的能力。对象是一些属性及服务的封装体,在程序设计领域,可以用“对象=数据+作用于这些数据上的操作”来表示。现实生活中对象是指客观世界的实体;在程序中对象是指一组变量和相关方法的集合。 2)类是既有相同操作功能和相同的数据格式的对象的集合与抽象!3)两者的关系:对象是类的具体实例.。 2.什么是面向对象的程序设计方法它有那些基本特征 答:面向对象程序设计从所处理的数据入手,以数据为中心而不是以服务为中心来描述系统。它把编程问题视为一个数据集合,数据相对于功能而言,具有更强的稳定性。 它的特征:抽象,封装,继承,多态。 3(无用) 4.请解释类属性、实例属性及其区别。 答:实例属性,由一个个的实例用来存储所有实例都需要的属性信息,不同实例的属性值可能会不同。 5.请解释类方法、实例属性及其区别。 答:实例方法表示特定对象的行为,在声明时前面不加static修饰符,在使用时需要发送给一个类实例。 类方法也称为静态方法,在方法声明时前面需加static修饰符,类方法表示具体实例中类对象的共有行为。 区别:实例方法可以直接访问实例变量,调用实例方法,实例方法可以直接访问类变量,调用类方法;类方法可以直接调用类变量和类方法,类方法不能直接调用实例变量和实例方法; 6.类的访问控制符有哪几种具体含义及其区别。 答:类的访问控制符只有public(公共类)及无修饰符(默认类)两种。 区别:当使用public修饰符时表示所有其他的类都可以使用此类;当没有修饰符时,则只有与此类处于同一包中的其他类可以使用类。 7类成员的访问控制符有哪几种他们对类成员分别有哪些访问限制的作用 答:类成员的访问控制符有 public,private,protecte及无修饰符. public(公有的):用public修饰的成分表示公有的,也就是它可以被其他任何对象访问(前提是对累成员所在的类访问有访问权限). Private(保护的):类中限定为private的成员只能被这个类本身 访问,在类外不可见。 proteced(保护的)用该关键字修饰的成分是受保护的,只可以被同一类及其子类的实例对象访问。 无修饰符(默认的):public,private,protected这个三个限定符不是必须写的。如果不写,则表明是“friendly”,相应的成分可以被所在保重的各类访问。 8简述构造方法的特点答:构造方法主要有以下特点: (1)构造方法的方法名与类名相同; (2)构造方法没有返回类型(修饰符void也不能有);(3)构造方法通常被声明为公有的(public); (4)构造方法可以有任意多个参数; (5)构造方法的主要作用是完成对象的初始化工作; (6)构造方法不能在程序中显式的调用; (7)在生成一个对象时,系统会自动调用该类的构造方法为新生成的对象初始化。 9如果在类声明中声明了构造方法,系统是否还提供默认的构造方法 答: 用户在进行类声明时,如果没有声明任何构造方法,系统会赋给此类一个默认(无参)的构造方法。但是,只要用户声明了构造方法,即使没有声明无参的构造方法,系统也不会再赋默认的构造方法。 10:声明Patient类表示在门诊室中的病人。此类对象应包括name(astring)\sex(achar)、age(an integer)、weight(a float0、allergies(a boolean). 声明存取及修改方法。在一个单独的累中,声明测试方法,并生成两个patient的例子: Atient april=new Patient(); (“zhangli”) (‘f’);; (330; ; (true); 那么:”+()); ”+()); ”+()); (“weught: ”+());\ ”+()); 声明并测试toString()方法显示一个病人的aga、sex、name及allergies属性。 答: public class Patient { private String name; private char sex; private int age; private float weight; private boolean allergies; public void setname(String a) { name=a; } public void setsex(char b) { sex=b; }

9月大学英语六级考试试题及参考答案

最牛英语口语培训模式:躺在家里练口语,全程外教一对一,三个月畅谈无阻! 洛基英语,免费体验全部在线一对一课程:https://www.doczj.com/doc/ad13942932.html,/wenkxd.htm(报名网址) 综合题,请根据题目给出的内容,来回答下面给出的试题。Part ⅡReading Comprehension (35 minutes) Directions: There are 4 passages in this part, Each passage is followed by some questions at unfinished statements. For each of them there are four choices marked A), B), C) and D). You should decide on the best choice and mark the corresponding letter on the Answer Sheet with a single line through the centre. Passage One Questions 21 to 25 are based on the following passage. In 1985 when a Japan Air Lines (JAL) jet crashed, its president, Yasumoto Takagi, called each victim’s family to apologize, and then promptly resigned. And in 1987, when a subsidiary of Toshiba sole sensitive military technology to the former Soviet Union, the chairman of Toshiba gave up his post. These executive actions, which Toshiba calls “the highest form of apology,”may seem bizarre to US managers. No one at Boeing resigned after the JAL crash, which may have been caused by a faulty Boeing repair. The difference between the two business cultures centers around different definitions of delegation. While US executives give both responsibility and authority to their employees, Japanese executives delegate only authority—the responsibility is still theirs. Although the subsidiary that sold the sensitive technology to the Soviets had its own management, the Toshiba top executives said they “must take personal responsibility for not creating an atmosphere throughout the Toshiba group that would make such activity unthinkable, even in an independently run subsidiary.” Such acceptance of community responsibility is not unique to businesses in Japan. School principals in Japan have resigned when their students committed major crimes after school hours. Even if they do not quit, Japanese executives will often accept primary responsibility in other ways, such as taking the first pay cut when a company gets into financial trouble. Such personal sacrifices, even if they are largely symbolic, help to create the sense of community and employee loyalty that is crucial to the Japanese way of doing business. Harvard Business School professor George Lodge calls the ritual acceptance of blame “almost a feudal (封建的) way of purging (清除) the community of dishonor,”and to some in the United States, such resignations look cowardly. However, in an era in which both business and governmental leaders seem particularly good at evading responsibility, many US managers would probably welcome an infusion (灌输) of the Japanese sense of responsibility, If, for instance,

《JAVA语言程序设计》期末考试试题及答案

《JA V A语言程序设计》期末考试试题及答案3 一、单项选择题 1、如下哪个是Java中的标识符() A、public B、super C、3number D、width 2、如下哪个是Java中的标识符( ) A、fieldname B、super C、3number D、#number 3、已知如下定义:String s = "story"; 下面哪个语句不是合法的( ) A、s += "books"; B、s = s + 100; C、int len = s.length; D、String t = s + “abc”; 4、如下哪个是Java中有效的关键字() A、name B、hello C、false D、good 5、下面的代码段执行之后count的值是什么( ) int count = 1; for (int i = 1; i <= 5; i++) { count += i; } System.out.println(count); A、5 B、1 C、15 D、16 6、定义一个类,必须使用的关键字是( ) A、public B、class C、interface D、static 7、定义一个接口必须使用的关键字是() A、public B、class C、interface D、static 8、如果容器组件p的布局是BorderLayout,则在p的下边中添加一个按钮b,应该使用的语句是() A、p.add(b); B、p.add(b,"North"); C、p.add(b,"South"); D、b.add(p,"North"); 9、声明并创建一个按钮对象b,应该使用的语句是() A、Button b=new Button(); B、button b=new button();

2006-2014历年大学英语六级听力真题及答案(完整版)

2006年——2014年六级听力真题及答案 200606 1. A) She met with Thomas just a few days ago. B) She can help with orientation program. C) She is not sure she can pass on the message. D) She will certainly try to contact Thomas. 2. A) Set the dinner table. B) Change the light bulb. C) Clean the dining room. D) Hold the ladder for him. 3. A) He’d like a piece of pie. B) He’d like some coffee. C) He’d rather stay in the warm room. D) He’d just had dinner with his friends. 4. A) He has managed to sell a number of cars. B) He is contented with his current position. C) He might get fired. D) He has lost his job. 5. A) Tony’s secretary. B) Paul’s girlfriend. C) Paul’s colleague. D) Tony’s wife. 6. A) He was fined for running a red light. B) He was caught speeding on a fast lane. C) He had to run quickly to get the ticket. D) He made a wrong turn at the intersection. 7. A) He has learned a lot from his own mistakes. B) He is quite experienced in taming wild dogs.

《Java语言程序设计基础教程》习题解答

《Java语言程序设计基础教程》练习思考题参考答案

第1章Java程序设计概述 1.9 练习思考题 1、Java运行平台包括三个版本,请选择正确的三项:() A. J2EE B. J2ME C. J2SE D. J2E 解答:A,B,C 2、Java JDK中反编译工具是:() A. javac B. java C. jdb D. javap 解答:D 3、public static void main方法的参数描述是:() A. String args[] B. String[] args C. Strings args[] D. String args 解答:A,B 4、在Java中,关于CLASSPATH环境变量的说法不正确的是:() A. CLASSPATH一旦设置之后不可修改,但可以将目录添加到该环境变量中。 B. 编译器用它来搜索各自的类文件。 C. CLASSPATH是一个目录列表。 D. 解释器用它来搜索各自的类文件。 解答:A 5、编译Java Application源文件将产生相应的字节码文件,扩展名为() A. .java B. .class C. .html D. .exe 解答:B 6、开发与运行Java程序需要经过的三个主要步骤为____________、____________和____________。 7、如果一个Java Applet源程序文件只定义有一个类,该类的类名为MyApplet,则类MyApplet必须是______类的子类并且存储该源程序文件的文件名为______。 8、如果一个Java Applet程序文件中定义有3个类,则使用Sun公司的JDK编译器编译该源程序文件将产生______个文件名与类名相同而扩展名为______的字节码文件。 9、开发与运行Java程序需要经过哪些主要步骤和过程? 10、Java程序是由什么组成的?一个程序中必须要有public类吗?Java源文件的命名规则是怎么样的? 11、编写一个简单的Java应用程序,该程序在命令行窗口输出两行文字:“你好,很高兴学习Java”和“We are students”。

英语六级考试真题试卷 完整版 第 套

2018年6月英语六级考试真题试卷附答案(完整版第2套)Part I Writing (30 minutes) Directions: For this part, you are allowed 30 minutes to write an essay on the importance of building trust between teachers and students. You can cite examples to illustrate your views. You should write at least 150 words but no more than 200 words. _______________________________________________________________ _______________________________________________________________ _______________________________________________________________ ___________________________ Part II Listening Comprehension (30 minutes) Section A Directions: In this section, you will hear two long conversations. At the end of each conversation, you will hear four questions. Both the conversation and the questions will be spoken only once. After you hear a question, you must choose the best answer from the four choices marked A), B), C) and D). Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre.

Java语言程序设计基础篇前三章课后习题要点

第1章计算机、程序和Java概述 1.1(显示三条消息)编写程序,显示Welcome to Java、Welcome to Computer Science和Programming is fun。 程序: 显示: 1.2(显示五条消息)编写程序,显示Welcome to Java五次 程序: 显示: 1.3(显示图案)编写一个程序,显示下面的图案:

程序: 显示: 1.4(打印表格)编写程序,显示以下表格: 程序: 显示:

1.5(计算表达式)编写程序,显示(9.5x4.5- 2.5x3)/(45.5- 3.5)的结果 程序: 显示: 1.6(数列求和)编写程序,显示1+2+3+4+5+6+7+8+9的结果 程序: 显示: 1.7(近似求π)可以使用以下公式计算π: Π=4x(1-1/3+1/5-1/7+1/9-1/11+1/13+...) 编写程序,显示4x(1-1/3+1/5-1/7+1/9-1/11+1/13...)的结果。在程序中用1.0代替1 程序: 显示:

第2章基本程序设计 2.1(将摄氏温度转换为华氏温度)编写程序,从控制台读入double型的摄氏温度,然后将其转换华氏温度,并显示结果。转换公式如下所示: Fahrenheit-=(9/5)*celsius+32 (华氏度=(9/5)*摄氏度+32) 程序: 显示: 2.2(计算圆柱体的体积)编写程序,读入圆柱体的半径和高,并使用下列公式计算圆柱体的体积 面积=半径x半径xπ 体积=面积x高 程序: 显示:

2.3(将英尺转换为米)编写程序,读入英尺数,将其转换为米数并显示结果。一英尺等于0.305米。 程序: 显示: 2.4(将磅转换为千克)编写程序,将磅数转换为千克数。程序提示用户输入磅数,然后转换成千克并显示结果。1磅等于0.454千克。 程序: 显示: 2.5(财务应用程序:计算小费)编写一个程序,读入一笔费用与酬金率,就算酬金和总钱数。例如,如果用户读入10作为费用,15%作为酬金率,计算结果显示酬金为$1.5,总费用为$11.5. 程序:

历年英语六级考试真题及答案【最新】

历年英语六级考试真题及答案 Part I Writing (30 minutes) Directions: For this part, you are allowed. 30 minutes to write an essay explaining why it is unwise to put all your eggs in one basket. You can give examples to illustrate your point. You should write at least 150 words but no more than 200 words. 注意:此部分试题请在答题卡1上作答。 Section A Directions: In this section, you will hear 8 short conversations and 2 long conversations. At the end of each conversation, one or more questions will be asked about what was said. Both the conversation and the questions will be spoken only once. After each question there will be a pause. During the pause, you must read the four choices marked A), B), C) and D), and decide which is the best answer. Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre.

java语言程序设计课后习题答案

习题2 3.使用“= =”对相同内容的字符串进行比较,看会产生什么样的结果。 答:首先创建一个字符串变量有两种方式:String str = new String("abc"); String str = "abc"; 使用“= =”会因为创建的形式不同而产生不同的结果: String str1 = "abc"; String str2 = "abc"; =str2); ; public class Exercise51{ public static void main(String[] args) throws IOException{ "请输入一个整数:"); InputStreamReader isStream=new InputStreamReader; BufferedReader bfReader=new BufferedReader(isStream); String input=(); int length=()-1; int n=new Integer(input).intValue(); while(length>=0){ int divisor=(int) (10,length); length=length-1; int output=n/divisor; n=n%divisor; ","); } } } 法二:(建议使用) public class Exercise5{ public static void main(String[] args){ int n=1678; int unit; int decimal; int hundred; int thousand; thousand=n/1000%10; hundred=n/100%10; decimal=n/10%10; unit=n%10; "1678包含的数字分别是: "+thousand+','+hundred+','+decimal+', '+unit); } } ;

《Java语言程序设计(一)》(课程代码04747)

《Java语言程序设计(一)》(课程代码04747) 第一大题:单项选择题 1、下列字符组合不能作为Java整型常量的是( ) ? A.078 ? B.0x3ACB ? C.5000 ? D.0x3ABC 参考答案:A 2、以下程序代码的输出结果是( ) int x = 10; while (x > 7) { System.out.print("*"); x--;} ? A.** ? B.*** ? C.* ? D.**** 参考答案:B 3、设类U声明,及对象u和v的定义如下: class U{ int x, int y; U(int a, int b){x= a; y = b;} void copy(U a){ x = a.x; y = a.y;} } U u = new U(1, 2), v = new U(2, 3); 在以下供选择的代码中,可能引起系统回收内存的是( ) ? A.u.x=v.y;u.y=v.x

? B.u=v ? C.u.copy ? D.v.copy(u) 参考答案:B 4、设有以下代码: String s l="123"; String s2="123"; String s3=new String("123"); 则表达式s1==s2和s1==s3的值分别是( ) ? A.true,true ? B.false,false ? C.true,false ? D.false,true 参考答案:C 5、以下关于AWT与Swing之间关系的叙述,正确的是( ) ? A.Swing是AWT的提高和扩展 ? B.在写GUI程序时,AWT和Swing不能同时使用? C.AWT和Swing在不同的平台上都有相同的表示? D.AWT中的类是从Swing继承的 参考答案:A 6、在以下Swing组件中,能为它指定布局管理器的是( ) ? A.JScrollBar对象 ? B.JMenuBar对象 ? C.JComboBox对象

(完整版)全国大学生英语六级考试最全历年真题

2018年12月英语六级真题(第一套) Part I Writing (30 minutes) Directions: For this part, you are allowed 30 minutes to write an essay on how to balance job responsibilities and personal interests. You can cite examples to illustrate your views. You should write at least 150 words but no more than 200 words. PartⅡListening Comprehension (30 minutes) 关注公众号“春秋大道”,无偿得到全部英语四六级历年真题(更新至2018年12月)+听力原频 Section A Directions: In this section, you will hear two long conversations. At the end of each conversation, you will hear four questions. Both the conversation and the questions will be spoken only once. After you hear a question, you must choose the best answer from the four choices marked A),B),C) and D). Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre. Questions 1 to 4 are based on the conversation you have just heard.

Java语言程序设计 第2版 (郑莉)课后习题答案

Java语言程序设计第2版(郑莉) 第二章习题答案 1.什么是对象、类,它们之间的联系? 答:1)对象是包含现实世界物体特征的抽象实体,它反映系统为之保存信息和与它交互的能力。对象是一些属性及服务的封装体,在程序设计领域,可以用“对象=数据+作用于这些数据上的操作”来表示。现实生活中对象是指客观世界的实体;在程序中对象是指一组变量和相关方法的集合。 2)类是既有相同操作功能和相同的数据格式的对象的集合与抽象! 3)两者的关系:对象是类的具体实例.。 2.什么是面向对象的程序设计方法?它有那些基本特征? 答:面向对象程序设计从所处理的数据入手,以数据为中心而不是以服务为中心来描述系统。它把编程问题视为一个数据集合,数据相对于功能而言,具有更强的稳定性。 它的特征:抽象,封装,继承,多态。 3(无用) 4.请解释类属性、实例属性及其区别。 答:实例属性,由一个个的实例用来存储所有实例都需要的属性信息,不同实例的属性值可能会不同。 5.请解释类方法、实例属性及其区别。 答:实例方法表示特定对象的行为,在声明时前面不加static修饰符,在使用时需要发送给一个类实例。 类方法也称为静态方法,在方法声明时前面需加static修饰符,类方法表示具体实例中类对象的共有行为。

量,调用类方法;类方法可以直接调用类变量和类方法,类方法不能直接调用实例变量和实例方法; 6.类的访问控制符有哪几种?具体含义及其区别。 答:类的访问控制符只有public(公共类)及无修饰符(默认类)两种。 区别:当使用public修饰符时表示所有其他的类都可以使用此类;当没有修饰符时,则只有与此类处于同一包中的其他类可以使用类。 7类成员的访问控制符有哪几种?他们对类成员分别有哪些访问限制的作用? 答:类成员的访问控制符有public,private,protecte及无修饰符. public(公有的):用public修饰的成分表示公有的,也就是它可以被其他任何对象访问(前提是对累成员所在的类访问有访问权限). Private(保护的):类中限定为private的成员只能被这个类本身 访问,在类外不可见。 proteced(保护的)用该关键字修饰的成分是受保护的,只可以 被同一类及其子类的实例对象访问。 无修饰符(默认的):public,private,protected这个三个限定符不是必须写的。如果不写,则表明是“friendly”,相应的成分可以被所在保重的各类访问。 8简述构造方法的特点? 答:构造方法主要有以下特点: (1)构造方法的方法名与类名相同; (2)构造方法没有返回类型(修饰符void也不能有); (3)构造方法通常被声明为公有的(public); (4)构造方法可以有任意多个参数; (5)构造方法的主要作用是完成对象的初始化工作;

全国大学生英语六级考试最全历年真题

2018 年12 月英语六级真题(第一套) Part I Writing (30 minutes) Directions: For this part, you are allowed 30 minutes to write an essay on how to balance job responsibilities and personal interests. You can cite examples to illustrate your views. You should write at least 150 words but no more than 200 words. Part n Listening Comprehension (30 minutes) 关注公众号“春秋大道”,无偿得到全部英语四六级历年真题(更新至2018 年12月) +听力原频 Section A Directions: In this section, you will hear two long conversations. At the end of each conversation, you will hear four questions. Both the conversation and the questions will be spoken only once. After you hear a question, you must choose the best answer from the four choices marked A) ,B),C) and D). Then mark the corresponding letter on Answer Sheet 1 with a single line through the centre. Questions 1 to 4 are based on the conversation you have just heard. 1. A) It can benefit professionals and non-professionals alike.

相关主题
文本预览
相关文档 最新文档