软件工程师笔试试题(JAVA)填空题(10分)执行下列代码后的结果是什么?intx,a=2,b=3,c=4;x=++a+b+++c++;包包含了Collection的接口和类的APImain方法的声明格式包括下列程序中构造了一个SET并且调用其方法add(),lassA{publicinthashCode(){return1;}publicBooleanequals(Objectb){returntrue}publicstaticvoidmain(Stringargs[]){Setset=newHashSet();(newA());(newA());(newA());(());}}下列程序的运行结果是classA{classDog{ privateStringname; privateintage; publicintstep; Dog(Strings,inta){name=s;age=a;step=0; } publicvoidrun(Dogfast){++; }} publicstaticvoidmain(Stringargs[]){ Aa=newA(); Dogd=("Tom",3); =25; (d); (); }}选择题(20分)欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的?A ArrayListmyList=newObject();B ListmyList=newArrayList();C ArrayListmyList=newList();D ListmyList=newList();paint()方法使用哪种类型的参数?A GraphicsB Graphics2DC StringD Color指出正确的表达式A byte=128;B Boolean=null;C longl=0xfffL;D double=;lassExample{ Stringstr=newString("good"); char[]ch={'a','b','c'}; publicstaticvoidmain(Stringargs[]){ Exampleex=newExample(); (,); (+"and"); (); } publicvoidchange(Stringstr,charch[]){ str="testok"; ch[0]='g'; }}A goodandabcB testokandabcD testokandgbc要从文件""文件中读出第10个字节到变量C中,下列哪个方法适合?A FileInputStreamin=newFileInputStream("");(9);intc=();B FileInputStreamin=newFileInputStream("");(10);intc=();C FileInputStreamin=newFileInputStream("");intc=();D essFilein=essFile("");(9);intc=();容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而改变?A CardLayoutB FlowLayoutC BorderLayoutD GridLayout给出下面代码:lassPerson{ staticintarr[]=newint[10]; publicstaticvoidmain(Stringa[]) { (arr[1]); }}那个语句是正确的?A 编译时将产生错误;B 编译时正确,运行时将产生错误;C 输出零;D 输出空。哪个关键字可以对对象加互斥锁?A transientB synchronizedC serializeD static下列哪些语句关于内存回收的说明是正确的?A 程序员必须创建一个线程来释放内存;B 内存回收程序负责释放无用内存C 内存回收程序允许程序员直接释放内存D 内存回收程序可以在指定的时间释放内存对象下列代码哪几行会出错:1)publicvoidmodify(){2)intI,j,k;3)I=100;4)while
软件工程师笔试试题(java) 来自淘豆网www.taodocs.com转载请标明出处.