为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

JAVA程序设计习题库及答案

2019-12-16 50页 doc 105KB 30阅读

用户头像 个人认证

东北往事

暂无简介

举报
JAVA程序设计习题库及答案rapiddevelopmentofthemarketeconomyenvironmenttoexplorepublicservants'dutyconsumptionmonetizationreformhasprovidedagoodfoundation.Thesocializationofrearserviceworkhasbeenlaunched,andrapidprogressinsomeplacesanddepartments,dutyconsumptionmonetizationofcarrierandap...
JAVA程序设计习题库及答案
rapiddevelopmentofthemarketeconomyenvironmenttoexplorepublicservants'dutyconsumptionmonetizationreformhasprovidedagoodfoundation.Thesocializationofrearserviceworkhasbeenlaunched,andrapidprogressinsomeplacesanddepartments,dutyconsumptionmonetizationofcarrierandapproachtomanagementhasbeenresolved.Third,inrecentyears,exploringthemonetizationofdutyconsumptionhasmadesomeprogress,havegainedsomeexperienceandcanprovidereferencetothecomprehensivereformofthesystemofpublicservants'dutyconsumptionfurther.Implementingan"honestcanteen",standardizeofficialentertainingmanagement;enhancingthetelecommunicationexpensemanagement;eliminationofCountytravelandcountrysidesubsidies;research"villageofficials"capitalizationmanagementofcorporatespending,andsoon.Finally,group...  18sessiontobeheldinBeijingfromNovember9,2013to12th.35yearsagoblewthethirdplenarysessionofthereformandopeningupinthespringbreeze,changed,affecttheworld;today,35yearslater,intheeyesofthenationandtheworldexpect,againtoreformmarkChina,usheredinthe18session.XIGeneralSecretarypointedoutthatChina'sreformhasenteredacrucialperiodandtheShamShuiPoDistrict,mustbebasedongreaterpoliticalcourageandwisdom,losenotimeindeepeningreforminimportantfields.Darestocrackahardnut,darestoquestiontheRapids,whichdarestobreakthebarrierofideas,anddaretobenefitcurebarriers.Deepeningreformandopeningupisonscheduletoachieveinstitutionalsafeguardsofthemoderatelywell-off.Underthe"fiveinone"theGenerallayoutofsocialistmodernizationrequirements,18sessionofthedecisionwasa"fiveinone"andtheimprovementofoverallschemeofreform,willpromoteanintegratedandcoordinatedeconomic,political,cultural,socialandecologicalcivilizationconstructionofthefivereformsandtheparty'sconstructionintheareaofinstitutionalreform.  The"fiveinone"programmeistoachieveacomprehensivereformofinstitutionalguaranteesforobjectivesofbuildawell-offsociety,thesmoothprogressoftheconstructionofawell-offsocietyandreformtheobjectivesoftheprogramme.  One,holdingtimeandplaceimportanceonNovember9,2013tothe18sessionofthe12thBeijingsince1978,35,havebeen7plenarysession,eachtimeonmajorissuesofpoliticalandeconomiclifeofthecountryhasmadeimportantdeployment.InaccordancewithPRCpoliticalpractice,oftenateverysessionoftheCPCCentralCommitteeinaplenarysessionwasheldimmediatelyaftertheparty'sCongress,onthetheme"personnel",discussingelectionCentral'stopleaders,suchastheelectionoftheStandingCommitteeofthepoliticalBureau,throughtheCentralCommitteemembers,decisions,suchasmembersoftheCentralMilitaryCommission.  Thesecondplenarysession,isheldintwosessionsbeforethegeneralelection,mainlytodiscussanewStatepersonnelissues.Butbythethirdrapiddevelopmentofthemarketeconomyenvironmenttoexplorepublicservants'dutyconsumptionmonetizationreformhasprovidedagoodfoundation.Thesocializationofrearserviceworkhasbeenlaunched,andrapidprogressinsomeplacesanddepartments,dutyconsumptionmonetizationofcarrierandapproachtomanagementhasbeenresolved.Third,inrecentyears,exploringthemonetizationofdutyconsumptionhasmadesomeprogress,havegainedsomeexperienceandcanprovidereferencetothecomprehensivereformofthesystemofpublicservants'dutyconsumptionfurther.Implementingan"honestcanteen",standardizeofficialentertainingmanagement;enhancingthetelecommunicationexpensemanagement;eliminationofCountytravelandcountrysidesubsidies;research"villageofficials"capitalizationmanagementofcorporatespending,andsoon.Finally,group...  18sessiontobeheldinBeijingfromNovember9,2013to12th.35yearsagoblewthethirdplenarysessionofthereformandopeningupinthespringbreeze,changed,affecttheworld;today,35yearslater,intheeyesofthenationandtheworldexpect,againtoreformmarkChina,usheredinthe18session.XIGeneralSecretarypointedoutthatChina'sreformhasenteredacrucialperiodandtheShamShuiPoDistrict,mustbebasedongreaterpoliticalcourageandwisdom,losenotimeindeepeningreforminimportantfields.Darestocrackahardnut,darestoquestiontheRapids,whichdarestobreakthebarrierofideas,anddaretobenefitcurebarriers.Deepeningreformandopeningupisonscheduletoachieveinstitutionalsafeguardsofthemoderatelywell-off.Underthe"fiveinone"theGenerallayoutofsocialistmodernizationrequirements,18sessionofthedecisionwasa"fiveinone"andtheimprovementofoverallschemeofreform,willpromoteanintegratedandcoordinatedeconomic,political,cultural,socialandecologicalcivilizationconstructionofthefivereformsandtheparty'sconstructionintheareaofinstitutionalreform.  The"fiveinone"programmeistoachieveacomprehensivereformofinstitutionalguaranteesforobjectivesofbuildawell-offsociety,thesmoothprogressoftheconstructionofawell-offsocietyandreformtheobjectivesoftheprogramme.  One,holdingtimeandplaceimportanceonNovember9,2013tothe18sessionofthe12thBeijingsince1978,35,havebeen7plenarysession,eachtimeonmajorissuesofpoliticalandeconomiclifeofthecountryhasmadeimportantdeployment.InaccordancewithPRCpoliticalpractice,oftenateverysessionoftheCPCCentralCommitteeinaplenarysessionwasheldimmediatelyaftertheparty'sCongress,onthetheme"personnel",discussingelectionCentral'stopleaders,suchastheelectionoftheStandingCommitteeofthepoliticalBureau,throughtheCentralCommitteemembers,decisions,suchasmembersoftheCentralMilitaryCommission.  Thesecondplenarysession,isheldintwosessionsbeforethegeneralelection,mainlytodiscussanewStatepersonnelissues.Butbythethirdrapiddevelopmentofthemarketeconomyenvironmenttoexplorepublicservants'dutyconsumptionmonetizationreformhasprovidedagoodfoundation.Thesocializationofrearserviceworkhasbeenlaunched,andrapidprogressinsomeplacesanddepartments,dutyconsumptionmonetizationofcarrierandapproachtomanagementhasbeenresolved.Third,inrecentyears,exploringthemonetizationofdutyconsumptionhasmadesomeprogress,havegainedsomeexperienceandcanprovidereferencetothecomprehensivereformofthesystemofpublicservants'dutyconsumptionfurther.Implementingan"honestcanteen",standardizeofficialentertainingmanagement;enhancingthetelecommunicationexpensemanagement;eliminationofCountytravelandcountrysidesubsidies;research"villageofficials"capitalizationmanagementofcorporatespending,andsoon.Finally,group...  18sessiontobeheldinBeijingfromNovember9,2013to12th.35yearsagoblewthethirdplenarysessionofthereformandopeningupinthespringbreeze,changed,affecttheworld;today,35yearslater,intheeyesofthenationandtheworldexpect,againtoreformmarkChina,usheredinthe18session.XIGeneralSecretarypointedoutthatChina'sreformhasenteredacrucialperiodandtheShamShuiPoDistrict,mustbebasedongreaterpoliticalcourageandwisdom,losenotimeindeepeningreforminimportantfields.Darestocrackahardnut,darestoquestiontheRapids,whichdarestobreakthebarrierofideas,anddaretobenefitcurebarriers.Deepeningreformandopeningupisonscheduletoachieveinstitutionalsafeguardsofthemoderatelywell-off.Underthe"fiveinone"theGenerallayoutofsocialistmodernizationrequirements,18sessionofthedecisionwasa"fiveinone"andtheimprovementofoverallschemeofreform,willpromoteanintegratedandcoordinatedeconomic,political,cultural,socialandecologicalcivilizationconstructionofthefivereformsandtheparty'sconstructionintheareaofinstitutionalreform.  The"fiveinone"programmeistoachieveacomprehensivereformofinstitutionalguaranteesforobjectivesofbuildawell-offsociety,thesmoothprogressoftheconstructionofawell-offsocietyandreformtheobjectivesoftheprogramme.  One,holdingtimeandplaceimportanceonNovember9,2013tothe18sessionofthe12thBeijingsince1978,35,havebeen7plenarysession,eachtimeonmajorissuesofpoliticalandeconomiclifeofthecountryhasmadeimportantdeployment.InaccordancewithPRCpoliticalpractice,oftenateverysessionoftheCPCCentralCommitteeinaplenarysessionwasheldimmediatelyaftertheparty'sCongress,onthetheme"personnel",discussingelectionCentral'stopleaders,suchastheelectionoftheStandingCommitteeofthepoliticalBureau,throughtheCentralCommitteemembers,decisions,suchasmembersoftheCentralMilitaryCommission.  Thesecondplenarysession,isheldintwosessionsbeforethegeneralelection,mainlytodiscussanewStatepersonnelissues.Butbythethird ★第一章Java语言概论     ★第二章Java语言基础    ★第三章面向对象程序★第四章Java小应用程序   ★第五章异常处理       ★第六章 图形与用户界面技术★第七章多线程           ★第八章多媒体编程      ★第九章输入与输出流★第十章网络通讯与编程   ★第十一章 Java语言的数据库访问技术 第一章 JAVA语言概论一、选择题1.      下列不属于java语言鲁棒性特点的是:A.    java能检查程序在变异和运行时的错误B.     java能运行虚拟机实现跨平台C.     java自己操纵内存减少了内存出错的可能性D.    java还实现了真数组,避免了覆盖数据的可能2.      java语言的执行模式是:A.    全编译型B.     全解释型C.     半编译和半解释型D.    同脚本语言的解释模式3.      下列关于虚拟机说法错误的是:A.    虚拟机可以用软件实现B.     虚拟机部可以用硬件实现C.     字节码是虚拟机的机器码D.    虚拟机把代码程序与各操作系统和硬件分开4.      java语言是1995年由()公司发布的A.    SunB.     MicrosoftC.     BorlandD.    FoxSoftware5.      下列不是虚拟机执行过程特点的是A.    双线程B.     多线程C.     动态链接D.    异常处理6.      java以JVM为基础,最下层是移植接口,由适配器和()组成A.    网卡B.     JavaosC.     Java基本类D.    Java应用程序和applet小程序7.      java程序的执行过程中用到一套JDK工具,其中javac.exe指A.    java语言编译器B.     java字节码解释器C.     java文档生成器D.    java类分解器8.      java的API结构中,不属于类库主要包括的核心包的是A.    java包B.     javaxC.     javadoc包D.    org扩展包9.      每个java的编译单元可包含多个类或界面,但是每个编译单元最多只能有()类或者界面是公共的A.    一个B.     两个C.     四个D.    任意多个10.  在当前的java实现中,每个编译单元就是一个以()为后缀的文件A.    javaB.     classC.     docD.    exe二、填空题1. 1991年,SUN公司的JameGosling和BillJoe等人,为电视、控制烤面包机等家用电器的交互操作开发了一个____软件,它是java的前身。2. java是一个网络编程语言,简单易学,利用了____的技术基础,但又独立于硬件结构,具有可移植性、健壮性、安全性、高性能。3. java可以跨平台的原因是____4. JVM的执行过程有三个特点:多线程,_____,异常处理;5. JAVA程序的安全性体现在多个层次上,在_____,有语法检查;在解释层上,有字节码校验器、测试代码段格式和规则检查,访问权限和类型转换和法性检查,操作数堆栈的上溢或下溢,代码参数类型合法性等;在平台层上,通过配置策略,可设定访问资源域,而无需区分本地或远程。6. JAVA的产品主流操作系统平台是Solaris、_____和Macintosh.7. JAVA系统运行时,通过______机制周期性的释放无用对象所使用的内存,完成对象的清除。8. 在JAVA语言中,将后缀名为______的源代码文件编译后形成后缀名为.class的字节码文件。9. JAVA语言的执行模式是半编译和______。10. JAVA类库具有_____的特点,保证了软件的可移植性。11. 在编写执行JAVA程序的过程中需要用到一些工具,SUN公司为我们提供了一套JDK工具,它主要包括:javac.exe、java.exe、_____、javap.exe、jkb.exe12. JAVA程序包括源代码(.java文件)、______、由归档工具jar生成的.jar文件、对象状态序列化.ser文件。13. 在JAVA语言中,为将源代码翻译成______文件时产生的错误称为编译错误。而将程序在运行中产生的错误称为运行错误。14. JavaApplication应用程序的编写和执行分3步进行:编写源代码、编译源代码、_____。15. 每个java应用程序可以包括许多方法,但必须有且只能有一个_____方法。16. JAVA源文件中最多只能有一个_____类,其它类的个数不限。17. JAVA的体系结构中,最下层是移植接口,上面一层是虚拟机,虚拟机的上层是_____和基本API,它们都是具有可扩展性。18. 类库主要包括核心JAVA包、_____和org扩展包。19. JAVA解释器采用生成与体系结构无关的______指令的技术,只需安装JAVA运行系统,就可保证JAVA程序可以在网络的任何地方运行。20. JAVA的体系结构中,最下层是_____,由适配器和JAVAOS组成,保证JAVA体系结构可以跨平台。第二章 Java语言基础一选择题1. 下列java标识符,错误的是()_sys_varl$changeUser_name1_file下列不属于简单数据类型的是()整数类型类符点数类型布尔类型下列属于JAVA关键词的是()TRUEgotofloatNULL下列声明和赋值语句错误的是doublew=3.1415;Stringstrl=”bye”;floatz=6.74567booleantruth=true;java中,八进制数以______开头。0x00X08自定义类型转换是由按优先关系从低级数据转换为高级数据,优先次序为()char-int-long-float-doubleint-long-float-double-charlong-float-int-double-char以上都不对在java中,Integer.MAX_VALUE示浮点类型最大值整数类型最大值长整型最大值以上说法都不对JAVA中,数据类型值中不可能出现的符号是()dfe/下列表示单引号的是()‘\\’\\\\’‘\\10. 下列语句片断中,four得值为:()intthree=3;charone=‘1’charfour=(char)(three+one);3131411. 下列不属于整型变量的类型是byteshortfloatlong12. int类型整型变量在内存中的位数为816326413. 下列数据类型转换,必须进行强制类型转换的是byte→intshort→longfloat→doubleint→char14. java中,用()关键字定义常量final#definefloatconst15. 关于变量的作用范围,下列说法错误的是异常处理参数作用域为整个类局部变量作用于声明该变量的方法代码段类变量作用于声明该变量的类方法参数作用于传递到方法内代码段16. 下列属于条件运算符的是+?:&&>> 17. 下列程序test类中的变量c的最后结果为publicclasstest{ publicstaticvoidmain(Stringargs[])  {    inta=10;    intb;intc;if(a>50)     {       b=9;     }    c=b+a;  }    }10019编译出错18. 下列程序片断的执行,说法正确的是publicclasstest{publicstaticvoidmain(Stringargs[]) {   byteb=100;   inti=b;   inta=2000;   b=a;   System.out.println(b);  } }b的值为100b的值为2000第六行出错第八行出错19. (&)语句的执行结果为20. 已知i为整形变量,关于一元运算++i和i++,下列说法正确的是A. ++i运算将出错B. 在任何情况下运行程序结果都一样C. 在任何情况下运行程序结果都不一样D. 在任何情况下变量i的值都增121.在java中语句:37.2%10的运算结果为A. 7.2B. 7C. 3D. 0.222. 在java语句中,运算符&&实现A. 逻辑或B. 逻辑与C. 逻辑非D. 逻辑相等23. 在java语句中,位运算操作数只能为整型或()数据A. 实型B.  字符型C.  布尔型D. 字符串型 (|)语句的执行结果为A. B. C. D. 25.  ~语句的执行结果为A. B. C. D. 26. 复合语句用()括起来的一段代码。小括号()大括号{}中括号〔〕单引号‘’下列不属于条件语句关键字的是ifelseswichwhile多分支语句switch(表达式){}中,表达式不可以返回哪种类型的值整型实型接口型字符型下面不属于java条件分支语句结构的是if结构if-else结构if-elseif结构if-elseelse机构30. 下列方法method()执行,返回值为        intmethod(){              intnum=10;              if(num>20)                 returnnum;              num=30;           }102030编译出错三元条件运算符ex1?ex2:ex3,相当于下面()语句。if(ex1)ex2;else ex3;if(ex2)ex1;else ex3;if(ex1)ex3;else ex2;if(ex3)ex2;else ex1;java用()来实现goto语句所特有的一些功能。breakdefaultcontinuereturn一个循环一般应包括哪几部分内容初始化部分循环体部分迭代部分和终止部分以上都是34. 关于while和do-while循环,下列说法正确的是两种循环除了格式不通外,功能完全相同与do-while语句不通的是,while语句的循环至少执行一次do-while语句首先计算终止条件,当条件满足时,才去执行循环体中的语句以上都不对。35. 下列程序输出结果为:    publicclasstest      {        publicstaticvoidmain(Stringargs[])            {               inta=0;               outer: for(inti=0;i<2;i++)                        {                          for(intj=0;j<2;j++)                            {                              if(j>i)                               {                                 continueouter;                                }                                a++;                             }                         }                System.out.println(a);             }        }023436.下列数组定义及赋值,错误的是A.    intintArray[];B.    intArray=newint[3];intArray[1]=1;intArray[2]=2;intArray[3]=3;C.    inta[]={1,2,3,4,5};D.    int[][]=newint[2][];a[0]=newint[3];a[1]=newint[3];37.在java中,字符串由java.lang.String和()定义E.    java.lang.StringCharF.    java.lang.StringBufferG.    java.io.StringCharH.    java.io.StringBuffer  二、填空题1.在java语言中,boolean型常量只有true和_____两个值。2.标识符是以_____、下划线、美元符号作为首字母的字符串序列。3.下面的语句是声明一个变量并赋值:  booleanb1=5!=8;b1的值是______。4.在java程序中,用关键字_____修饰的常量对象创建后就不能再修改了。5.数据类型包括简单数据类型和复合数据类型。复合数据类型又包括类、数组、______。6.八进制整数012表示十进制的_______。7.浮点型数据属于实型数据,分为float和______两种类型。8.类变量在类中声明,而不是在类的某个方法中声明,它的作用域是______.9.java语言中的各种数据类型之间提供自动转换,如第1操作数是byte类型,第2操作数是float类型,其结果是_____类型。10.在java语言中,如果数值后没有字母,计算机默认值为______类型。11.下面程序分别用while、do-while和for语句实现1~10累计求和。请在横线处填入适当内容完成程序。PublicclassSum { publicstaticvoidmain(Stringargs[])  {    System.out.println(“\\n*****while循环*****”);        intn=10,sum=0;        while(_______)        {         sum+=n;         n--;       }System.out.println(“sumis”+sum);System.out.println(“\\n******do_while循环******”);n=0;sum=0;do  {   sum+=n;   n++;   }while(_______); System.out.println(“sumis”+sum); System.out.println(“\\n******for循环******”); sum=0; for(intI=1;_______i++)  {     sum+=I}System.out.println(“sumis”+sum);}}定义double型数组doubled1[]={1.2,2.3,3.4,4.5,5.6}则d1[2]=_______数组是有序数据的集合,数组中的每个元素具有相同的________14.下列程序输出结果为_______publicclasstest{ publicstaticvoidmain(Stringargs[]) {Strings=”Iamastring!”;Intn=s.length();Charc=s.charAt(7);System.out.println(n);System.out.println(c);}        }    第三章面向对象程序设计一、选择题2.        下列不属于面向对象编程的三个特征的是A.    封装B.    指针操作C.    多态性D.    继承3.        类所实现的接口以及修饰不可以是A.    
/
本文档为【JAVA程序设计习题库及答案】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索