资源描述:
《java基础入学测试》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、考试题目:本试卷是JAVA基础班入学考试试卷,主要考察JAVA基础前五天大家在入学之前掌握的一个整体情况,本试卷共有40道题,其中有30道是单选,有10道题是多选题,希望大家认真对待1.请问,以下哪些是正确的Java注释形式?请选择所有正确答案:BCA\Thisisacomment.B/*Thisisacomment.*/C/**Thisisacomment.*/D*Thisisacomment.*2.请问,以下哪些是合法变量名?ABAvariable123B_largeC6fredDvoid3.请问,以下哪此是Java中不合法的关键字?请选择所有正确答案:A
2、AbooleanBpublicCmainotherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwe
3、stOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,MinistersandDvoid1.请问,int型数据占几个字节?CA取决于这个int类型有多大B2字节C4字节D8字节2.请问byte数据的取值范围是?CA0-128B负127-128C负128-127D以上都不对3.给出以下代码,请问该程
4、序的运行结果是什么?AclassExample{publicstaticvoidmain(Stringargs[]){booleanflag=false;if(flag=true){System.out.println(“true”);}else{System.out.println(“false”);}}otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.St
5、artingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitt
6、eeSecretary,Ministersand}A代码编译失败,if语句错误。B打印输出true。C打印输出false。D无内容输出。1.给出以下代码,请问该程序的运行结果是什么?classExample{publicstaticvoidmain(Stringargs[]){booleanb=true;System.out.println(b);}}请选择一个正确答案:AA打印输出true。B打印输出b。C编译错误,因为System.out.println()方法的参数只能为整数。D无内容输出。2.请问,以下哪些是十进制数123的正确的八进制表示?请选择一个正确答
7、案:AA0173B123C0x123otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwe