首页 Java软件中级工程师笔试题复杂逻辑

Java软件中级工程师笔试题复杂逻辑

举报
开通vip

Java软件中级工程师笔试题复杂逻辑Revisedat2pmonDecember25,2020.Java软件中级工程师笔试题复杂逻辑J2EE部分1、运算符优先级问题,下面代码的结果是多少(笔试)packagetest;publicclassTest{publicstaticvoidmain(String[]args){intk=0;intret=++k+k+++++k+k;ethod();}publicvoidmethod(){}}classBase{}8、trueorfalse?packagetest;publicclassTest{publics...

Java软件中级工程师笔试题复杂逻辑
Revisedat2pmonDecember25,2020.Java软件中级工程师笔试 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 复杂逻辑J2EE部分1、运算符优先级问题,下面代码的结果是多少(笔试)packagetest;publicclassTest{publicstaticvoidmain(String[]args){intk=0;intret=++k+k+++++k+k;ethod();}publicvoidmethod(){}}classBase{}8、trueorfalse?packagetest;publicclassTest{publicstaticvoidmain(String[]args){Stringstr1=newString("abc");Stringstr2=newString("abc");StringBuffersb1=newStringBuffer("abc");StringBuffersb2=newStringBuffer("abc");}}9、输出的结果是什么packagetest;publicclassTest{publicstaticvoidmain(String[]args){}publicintmethod1(){intx=1;try{returnx;}finally{++x;}}publicintmethod2(){intx=1;try{returnx;}finally{return++x;}}}这样呢?输出什么packagetest;publicclassTest{publicstaticvoidmain(String[]args){}publicstaticbooleanmethod(){try{returntrue;}finally{returnfalse;}}}10、方法m1和m2有区别吗?什么区别packagetest;publicclassTest{publicstaticvoidmain(String[]args){}publicsynchronizedvoidm1(){}publicstaticsynchronizedvoidm2(){}}11、trueorfalse?理由packagetest;publicclassTest{publicstaticvoidmain(String[]args){Integeri1=127;Integeri2=127;i1=128;i2=128;}}12、trueorfalse?理由packagetest;publicclassTest{publicstaticvoidmain(String[]args){Stringstr1="a";Stringstr2="a";Stringstr3=newString("a");str3=();}}13、trueorfalse?理由packagetest;publicclassTest{publicstaticvoidmain(String[]args){}}14、以下代码输出是什么packagetest;publicclassTest{publicstaticvoidmain(String[]args){BigIntegerone=newBigInteger("1");BigIntegertwo=newBigInteger("2");BigIntegerthree=newBigInteger("3");BigIntegersum=newBigInteger("0");(one);(two);(three);}}15、输出的结果是什么12345根据单词排序还是packagetest;publicclassTest{publicstaticvoidmain(String[]args){Setset=newHashSet();("one");("two");("three");("four");("five");for(Iteratorit=();();){}}}16、以下代码输出的结果(笔试选择题)publicclassTest{publicstaticvoidmain(String[]args){}}A.nullB.0C.Test17、下面为一个单例的实现代码,请指出代码中有几个错误或不合理之处,并改正。publicclassTest{publicTestinstance=null;publicstaticTestgetInstance(){if(instance==null){instance=newTest();returninstance;}}}18、编程输出一个目录下的所有目录及文件名称,目录之间用tab。(笔试)19、从键盘读入10个整数,然后从大到小输出。(笔试)20、如何迭代Map容器,手写个试试? 答案 八年级地理上册填图题岩土工程勘察试题省略号的作用及举例应急救援安全知识车间5s试题及答案 :1、82、i1+i2=1010语法错误i1*i2=100i1/i2=13、string4、5195、126、testtest7、8、truefalse9、12false10、A:synchronizedstatic是某个类的范围,synchronizedstaticcSync{}防止多个线程同时访问这个类中的synchronizedstatic方法。它可以对类的所有对象实例起作用。B:synchronized是某实例的范围,synchronizedisSync(){}防止多个线程同时访问这个实例中的synchronized方法。11、truefalse12、truefalsetrue13、false14、015、twofiveonethreefour16、B17、getInstance无默认返回值instance?必须是static18、packagetest;publicclassTest{publicstaticvoidmain(String[]args){newTest().read("D:/test","");}publicvoidread(Stringpath,Stringtab){Filefile=newFile(path);File[]childFiles=();for(inti=0;childFiles!=null&&i<;i++){if(childFiles[i].isDirectory()){read(childFiles[i].getPath(),tab+"\t");}}}}19、packagetest;publicclassTest{publicstaticvoidmain(String[]args){Scannerin=newScanner;//注意这里的数组,不是int的Integer[]arr=newInteger[10];for(inti=0;i<10;i++){arr[i]=();}(arr,newComparator(){@Overridepublicintcompare(Integero1,Integero2){if(o1>o2)return-1;if(o1m=newHashMap();Set>set=();Iterator>it=();while()){entry=();Classkey=();Stringvalue=();}}}
本文档为【Java软件中级工程师笔试题复杂逻辑】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
个人认证用户
禹辰
台资企业EPM项目管理者
格式:doc
大小:711KB
软件:Word
页数:0
分类:企业经营
上传时间:2021-10-20
浏览量:2