电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc

上传人:文库蛋蛋多 文档编号:2198464 上传时间:2023-01-29 格式:DOC 页数:6 大小:59.51KB
返回 下载 相关 举报
电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc_第1页
第1页 / 共6页
电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc_第2页
第2页 / 共6页
电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc_第3页
第3页 / 共6页
电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc_第4页
第4页 / 共6页
电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc》由会员分享,可在线阅读,更多相关《电大《JAVA语言与面向对象程序设计》专科期末复习试题及答案小抄.doc(6页珍藏版)》请在三一办公上搜索。

1、电大JAVA语言与面向对象程序设计期末复习试题及答案小抄一、单选择题(每小题2分,共30分)1、编译Java Application 源程序文件将产生相应的字节码文件,这些字节码文件的扩展名为( )。(A)java(B)class(C)html(D)exe2、已知表达式intm=0,1,2,3,4,5,6;下面哪个表达式的值与数组元素个数相等?( )。(A) m.length() (B) m.length(C) m.length()+1 (D) m.length+13、在Java Applet程序用户自定义的Applet子类中,一般需要覆盖父类的( )方法来完成一些画图操作。(A)start(

2、 ) (B)stop( ) (C) init( ) (D) paint( )4、如下哪个字符串是Java中的标识符?( )。(A) fieldname (B) super (C) 3number (D) #number5、关于被私有访问控制符private修饰的成员变量,以下说法正确的是( ) (A)可被三种类引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类 (B)可以被两种类访问和引用:该类本身、该类的所有子类 (C)只能被该类自身所访问和修改 (D)只能被同一个包中的类访问6、Java中main()函数的值是什么类型?( ) (A) String (B) int(C) ch

3、ar (D) void7、执行完代码int x = new int25;后,以下哪项说明是正确的( ) (A)x24为0 (B)x24未定义 (C)x25为0 (D)x0为空8、以下代码段执行后的输出结果为( ) int x=3; int y=10; System.out.println(y%x); (A)0 (B)1 (C)2 (D)39、已知如下代码:publicclassTestlonga=newlong10;publicstaticvoidmain(Stringarg)System.out.println(a6);请问下面哪个语句是正确的( )(A) Outputisnull. (B)

4、 Outputis0.(C) Whencompile,someerrorwilloccur. (D) Whenrunning,someerrorwilloccur.10、给出下面的代码段:publicclassBaseintw,x,y,z;publicBase(inta,intb)x=a;y=b;publicBase(inta,intb,intc,intd)/assignmentx=a,y=bw=d;z=c;在代码说明/assignmentx=a,y=b处写入如下哪个代码是正确的?( )(A) Base(a,b); (B) x=a,y=b; (C) super(a,b); (D) this(a

5、,b);11、给出如下代码:class Testprivate int m;public static void fun() / some code.如何使成员变量m 被函数fun()直接访问( ) (A)将private int m 改为protected int m (B)将private int m 改为 public int m (C)将private int m 改为 static int m (D)将private int m 改为 int m12、下面哪个函数是public void example().的重载函数( ) (A)public double example2(int

6、 m). 4(B)public int example(). (C)public void example2(). (D)public int example ( int m, float f).13、以命令”java MyTest a b c”执行文件MyTest.class后,表达式( )为真 (A)args0 = MyTest a b c (B)args0 = MyTest (C)args0 = a(D)args1= b14、当包含applet的页面被重新加载时会自动调用以下哪个函数?( ) (A) init() (B) start()(C) stop() (D) destroy()15

7、、在编写Java Applet程序时,若需要对发生的事件作出响应和处理,一般需要在程序的开头写上( )语句(A) import java.awt.*;(B) import java.applet.* ; (C) import java.io.* ; (D) import java.awt.event.* ;二、判断题 (每小题2分,共20分)1、Java的字符类型采用的是ASCII编码。2、class A.等价于class A extends Object.。 3、抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。 4、Java中数组的元素可以是简单数据类型的量,也可以是某一类的对象

8、。 5、一个Java类可以有多个父类。 6、子类的域和方法的数目一定大于等于父类的域和方法的数目。 7、System类不能实例化,即不能创建System类的对象。 8、接口里的方法必须全部都声明成abstract。 9、最终类不能派生子类,最终方法不能被重载。 10、设String对象s=”Hello ”,运行语句System.out.println(s.concat(“World!”);后String对象s的内容为”Hello world!”,所以语句输出为:Hello world!。 三、填空题(每空格2分,共20分)1、根据程序的构成和运行环境的不同,Java源程序分为两类:_程序和_程

9、序。2、在Java的基本数据类型中,char型采用Unicode编码方案,每个Unicode码占用_字节内存空间。3、在Java程序中,通过类的定义只能实现_重继承,但通过接口的定义可以实现_重继承关系。4、_方法是一种仅有方法头,没有具体方法体和操作实现的方法,该方法必须在抽象类或接口之中定义。_方法是不能被当前类的子类重新定义的方法。5、如果一个Java Applet源程序文件只定义有一个类,该类的类名为MyApplet,则类MyApplet必须是_类的子类并且存储该源程序文件的文件名为_。6、Java中所有类都是类_ 的子类。四、写出下列程序的输出。(每小题5分,共20分)1、 clas

10、s Parentvoid printMe()System.out.println(“parent”);class Child extends Parentvoid printMe()System.out.println(“child”);void printAll()super.printMe();this.printMe();printMe();public class Test_thispublic static void main(String args )Child myC=new Child();myC.printAll();2、public class Test public st

11、atic void main(String args) int a=new int5; for(int i=0;i0;i-) System.out.println(a+i+=+ai); 3、public class BreakLoop public static void main(String args) int num=5; for (num=1;num5;num+) System.out.println(num1=+num); System.out.println(-); for (num=1;num5;num+) if (num=3) break; System.out.println

12、(num2=+num); System.out.println(-); for (num=1;num5;num+) if (num=3) continue; System.out.println(num3=+num); 4、public class CruncherCrunch( int i )System.out.println(“int version”);Crunch(String s)System.out.println(“String version”);public static void main(String args )new Cruncher (1);五、使用Java语言编

13、写程序。(共10分)1、编写一个字符界面的Java Application 程序,接受用户输入的10个整数,并输出这10个整数的最大值和最小值。JAVA语言与面向对象程序设计标准答案一、单选择题(每小题2分,共30分)1. B2. B3. D4. A5. C6. D7. A8. B9. C10. D 11. C12. D13. C 14. B15. D二、判断题 (每小题2分,共20分)1. 2. 3. 4. 5. 6. 7. 8.9. 10. 三、填空题(每空格2分,共20分)1. Application Applet 2. 2 3. 单重 多重 4. 抽象 最终 5. Applet MyA

14、pplet.java 4. Object 四、写出下列程序的输出。(每小题5分,共20分)1. parentchildchild2. a3= 3 a2= 2a1= 1 3. num1=1 num1=2 num1=3 num1=4- num2=1 num2=2- num3=1 num3=2 num3=44. int version五、使用Java语言编写程序。(共10分)import java.io.*;public class maxandminpublic static void main(String args)int max=0, min=0, value=0;for (int i=1;

15、 imax ? value : max;min = valuemin ? value : min;catch(NumberFormatException enf)System.out.println(整数格式输入错误,请重新输入。n);i-;catch(IOException ioe)System.out.println(一般输入输出错误,程序终止。);System.exit(0);/ end of forSystem.out.println(最大数为: + max);System.out.println(最小数为: + min);/ end of method/ end of class请您

16、删除一下内容,O(_)O谢谢!【Chinas 10 must-see animations】The Chinese animation industry has seen considerable growth in the last several years. It went through a golden age in the late 1970s and 1980s when successively brilliant animation work was produced. Here are 10 must-see classics from Chinas animation o

17、utpouring that are not to be missed. Lets recall these colorful images that brought the country great joy. Calabash Brothers Calabash Brothers (Chinese: 葫芦娃) is a Chinese animation TV series produced byShanghaiAnimationFilmStudio. In the 1980s the series was one of the most popular animations in Chi

18、na. It was released at a point when the Chinese animation industry was in a relatively downed state compared to the rest of the international community. Still, the series was translated into 7 different languages. The episodes were produced with a vast amount of paper-cut animations. Black Cat Detec

19、tive Black Cat Detective (Chinese: 黑猫警长) is a Chinese animation television series produced by the Shanghai Animation Film Studio. It is sometimes known as Mr. Black. The series was originally aired from 1984 to 1987. In June 2006, a rebroadcasting of the original series was announced. Critics bemoan

20、 the series violence, and lack of suitability for childrens education. Proponents of the show claim that it is merely for entertainment. Effendi Effendi, meaning sir andteacher in Turkish, is the respectful name for people who own wisdom and knowledge. The heros real name was Nasreddin. He was wise

21、and witty and, more importantly, he had the courage to resist the exploitation of noblemen. He was also full of compassion and tried his best to help poor people. Adventure of Shuke and Beita【舒克与贝塔】 Adventure of Shuke and Beita (Chinese: 舒克和贝塔) is a classic animation by Zheng Yuanjie, who is known a

22、s King of Fairy Tales in China. Shuke and Beita are two mice who dont want to steal food like other mice. Shuke became a pilot and Beita became a tank driver, and the pair met accidentally and became good friends. Then they befriended a boy named Pipilu. With the help of PiPilu, they co-founded an a

23、irline named Shuke Beita Airlines to help other animals. Although there are only 13 episodes in this series, the content is very compact and attractive. The animation shows the preciousness of friendship and how people should be brave when facing difficulties. Even adults recalling this animation to

24、day can still feel touched by some scenes. Secrets of the Heavenly Book Secrets of the Heavenly Book, (Chinese: 天书奇谈)also referred to as Legend of the Sealed Book or Tales about the Heavenly Book, was released in 1983. The film was produced with rigorous dubbing and fluid combination of music and vi

25、vid animations. The story is based on the classic literature Ping Yao Zhuan, meaning The Suppression of the Demons by Feng Menglong. Yuangong, the deacon, opened the shrine and exposed the holy book to the human world. He carved the books contents on the stone wall of a white cloud cave in the mount

26、ains. He was then punished with guarding the book for life by the jade emperor for breaking heavens law. In order to pass this holy book to human beings, he would have to get by the antagonist fox. The whole animation is characterized by charming Chinesepainting, including pavilions, ancient archite

27、cture, rippling streams and crowded markets, which fully demonstrate the unique beauty of Chinas natural scenery. Pleasant Goat and Big Big Wolf【喜洋洋与灰太狼】 Pleasant Goat and Big Big Wolf (Chinese:喜羊羊与灰太狼) is a Chinese animated television series. The show is about a group of goats living on the Green P

28、asture, and the story revolves around a clumsy wolf who wants to eat them. It is a popular domestic animation series and has been adapted intomovies. Nezha Conquers the Dragon King(Chinese: 哪吒闹海)is an outstanding animation issued by the Ministry of Culture in 1979 and is based on an episode from the

29、 Chinese mythological novel Fengshen Yanyi. A mother gave birth to a ball of flesh shaped like a lotus bud. The father, Li Jing, chopped open the ball, and beautiful boy, Nezha, sprung out. One day, when Nezha was seven years old, he went to the nearby seashore for a swim and killed the third son of

30、 the Dragon King who was persecuting local residents. The story primarily revolves around the Dragon Kings feud with Nezha over his sons death. Through bravery and wit, Nezha finally broke into the underwater palace and successfully defeated him. The film shows various kinds of attractive sceneries

31、and the traditional culture of China, such as spectacular mountains, elegant sea waves and exquisite ancient Chinese clothes. It has received a variety of awards. Havoc in Heaven The story of Havoc in Heaven(Chinese: 大闹天宫)is based on the earliest chapters of the classic storyJourney to the West. The

32、 main character is Sun Wukong, aka the Monkey King, who rebels against the Jade Emperor of heaven. The stylized animation and drums and percussion accompaniment used in this film are heavily influenced byBeijingOpera traditions. The name of the movie became a colloquialism in the Chinese language to

33、 describe someone making a mess. Regardless that it was an animated film, it still became one of the most influential films in all of Asia. Countless cartoon adaptations that followed have reused the same classic story Journey to the West, yet many consider this 1964 iteration to be the most origina

34、l, fitting and memorable, The Golden Monkey Defeats a Demon【金猴降妖】 The Golden Monkey Defeats a Demon (Chinese: 金猴降妖), also referred as The Monkey King Conquers the Demon, is adapted from chapters of the Chinese classics Journey to the West, or Monkey in the Western world. The five-episode animation s

35、eries tells the story of Monkey King Sun Wukong, who followed Monk Xuan Zangs trip to the West to take the Buddhistic sutra. They met a white bone evil, and the evil transformed human appearances three times to seduce the monk. Twice Monkey King recognized it and brought it down. The monk was unable

36、 to recognize the monster and expelled Sun Wukong. Xuan Zang was then captured by the monster. Fortunately Bajie, another apprentice of Xuan Zang, escaped and persuaded the Monkey King to come rescue the monk. Finally, Sun kills the evil and saves Xuan Zang. The outstanding animation has received a

37、variety of awards, including the 6th Hundred Flowers Festival Award and the Chicago International Childrens Film Festival Award in 1989. McDull【麦兜】 McDull is a cartoon pig character that was created inHong Kongby Alice Mak and Brian Tse. Although McDull made his first appearances as a supporting cha

38、racter in the McMug comics, McDull has since become a central character in his own right, attracting a huge following in Hong Kong. The first McDull movie McMug Story My Life as McDull documented his life and the relationship between him and his mother.The McMug Story My Life as McDull is also being translated into French and shown in France. In this version, Mak Bing is the mother of McDull, not his father.

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 教育教学 > 成人教育


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号