Java软件中级工程师笔试题复杂逻辑Word文档格式.docx

上传人:b****2 文档编号:1551117 上传时间:2023-04-30 格式:DOCX 页数:16 大小:17.27KB
下载 相关 举报
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第1页
第1页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第2页
第2页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第3页
第3页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第4页
第4页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第5页
第5页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第6页
第6页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第7页
第7页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第8页
第8页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第9页
第9页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第10页
第10页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第11页
第11页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第12页
第12页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第13页
第13页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第14页
第14页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第15页
第15页 / 共16页
Java软件中级工程师笔试题复杂逻辑Word文档格式.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

Java软件中级工程师笔试题复杂逻辑Word文档格式.docx

《Java软件中级工程师笔试题复杂逻辑Word文档格式.docx》由会员分享,可在线阅读,更多相关《Java软件中级工程师笔试题复杂逻辑Word文档格式.docx(16页珍藏版)》请在冰点文库上搜索。

Java软件中级工程师笔试题复杂逻辑Word文档格式.docx

System.err.println(object);

Testt=newTest();

t.myMethod(null);

..

月8日,下面代码输出什么?

(笔试)4、假设今天是9packagetest;

importjava.util.Date;

Datedate=newDate();

System.err.println(date.getMonth()++date.getDate());

、下面代码的输出结果是什么?

5packagetest;

doubleval=11.5;

System.err.println(Math.round(val));

System.err.println(Math.floor(val));

System.err.println(Math.ceil(val));

6、下面代码的结果是什么?

packagetest;

publicclassTestextendsBase{

publicstaticvoidmain(String[]args){

Baseb=newTest();

b.method();

Testt=newTest();

t.method();

@Override

publicvoidmethod(){

System.err.println(est);

classBase{

publicvoidmethod()throwsInterruptedException{

System.err.println(ase);

、以下代码的结果是什么?

7packagetest;

newTest().method();

publicvoidmethod(){

System.err.println(super.getClass().getName());

System.err.println(this.getClass().getSuperclass().getName());

、trueorfalse8packagetest;

Stringstr1=newString(abc);

Stringstr2=newString(abc);

System.err.println(str1.equals(str2));

StringBuffersb1=newStringBuffer(abc);

StringBuffersb2=newStringBuffer(abc);

System.err.println(sb1.equals(sb2));

9、输出的结果是什么?

System.err.println(newTest().method1());

System.err.println(newTest().method2());

publicintmethod1(){

intx=1;

try{

returnx;

}finally{

++x;

publicintmethod2(){

intx=1;

try{

returnx;

}finally{

return++x;

这样呢?

输出什么packagetest;

System.err.println(method());

publicstaticbooleanmethod(){

returntrue;

returnfalse;

m2有区别吗?

什么区别m110、方法和packagetest;

publicsynchronizedvoidm1(){

publicstaticsynchronizedvoidm2(){

11、trueorfalse?

理由

Integeri1=127;

Integeri2=127;

System.err.println(i1==i2);

i1=128;

i2=128;

理由12、trueorfalsepackagetest;

Stringstr1=a;

Stringstr2=a;

Stringstr3=newString(a);

System.err.println(str1==str2);

System.err.println(str1==str3);

str3=str3.intern();

理由13、trueorfalsepackagetest;

System.err.println(12-11.9==0.1);

14、以下代码输出是什么?

importjava.math.BigInteger;

BigIntegerone=newBigInteger();

BigIntegertwo=newBigInteger();

BigIntegerthree=newBigInteger();

BigIntegersum=newBigInteger(

sum.add(one);

sum.add(two);

sum.add(three);

System.out.println(sum.toString());

12345?

根据单词排序?

还是?

15、输出的结果是什么?

importjava.util.HashSet;

importjava.util.Iterator;

importjava.util.Set;

Set<

String>

set=newHashSet<

();

set.add(one);

set.add(wo);

set.add(hree);

set.add(

our);

ive);

for(Iterator<

it=set.iterator();

it.hasNext();

){

System.err.println(it.next());

16、以下代码输出的结果(笔试选择题)

System.err.println(args.length);

C.Test

B.0A.null

D.Exceptioninthreadmainjava.lang.NullPointerException

17、下面为一个单例的实现代码,请指出代码中有几个错误或不合理之处,并改正。

publicTestinstance=null;

publicstaticTestgetInstance(){

if(instance==null){

instance=newTest();

returninstance;

18、编程输出一个目录下的所有目录及文件名称,目录之间用tab。

(笔试)

19、从键盘读入10个整数,然后从大到小输出。

20、如何迭代Map容器,手写个试试?

答案:

1、8

2、

i1+i2=1010语法错误

i1*i2=100

i1/i2=1

3、

string

4、519

5、1211.012.0

6、testtest

7、test.Testtest.Base

、8truefalse

9、

12false

10、A:

synchronizedstatic是某个类的范围,cSync{}防止多个线程同staticsynchronizedsynchronizedstatic时访问这个类中的方法。

它可以对类的所有对象实例起作用。

是某实例的范围,B:

synchronized

防止多个线程同时synchronizedisSync(){}方法。

synchronized访问这个实例中的

11、

truefalse

12、truefalse

true

13、

false

14、0

15、twofive

one

three

four

、16B

17、无默认返回值getInstance

static必须是instance

18、

importjava.io.File;

newTest().read(D:

/test,\);

publicvoidread(Stringpath,Stringtab){

Filefile=newFile(path);

File[]childFiles=file.listFiles();

for(inti=0;

childFiles!

=null&

&

i<

childFiles.length;

i++){

System.err.println(tab+childFiles[i].getName());

if(childFiles[i].isDirectory()){

read(childFiles[i].getPath(),tab+\);

、19packagetest;

importjava.util.Arrays;

importjava.util.Comparator;

importjava.util.Scanner;

Scannerin=newScanner(System.in);

的注意这里的数组,不是int//

Integer[]arr=newInteger[10];

10;

arr[i]=in.nextInt();

Arrays.sort(arr,newComparator<

Integer>

(){

@Override

publicintcompare(Integero1,Integero2){

if(o1>

o2)return-1;

if(o1<

o2)return1;

return0;

});

System.err.println(Arrays.toString(arr));

20、packagetest;

importjava.util.HashMap;

importjava.util.Map;

importjava.util.Map.Entry;

Map<

Class,String>

m=newHashMap<

Entry<

>

set=m.entrySet();

Iterator<

while(it.hasNext()){

Map.Entry<

entry=it.next();

Classkey=entry.getKey();

Stringvalue=entry.getValue();

System.out.println(key.toString()++value.toString());

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

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2