上海神机软件有限公司.doc
- 文档编号:232770
- 上传时间:2022-10-07
- 格式:DOC
- 页数:13
- 大小:293KB
上海神机软件有限公司.doc
《上海神机软件有限公司.doc》由会员分享,可在线阅读,更多相关《上海神机软件有限公司.doc(13页珍藏版)》请在冰豆网上搜索。
选择题
1:
Whichofthefollowingansweriscorrecttoexpressthevalue8inoctalnumber?
A.010
B.0x10
C.08
D.0x8
2:
Whichstatementaboutlisteneristrue?
A.Mostcomponentallowmultiplelistenerstobeadded.
B.Ifmultiplelistenerbeaddtoasinglecomponent,theeventonlyaffectedonelistener.
C.Componentdon?
tallowmultiplelistenerstobeadd.
D.none
3:
Give the following java class:
public class Example{
static int x[]=new int[15];
public static void main(String args[]){
System.out.println(x[5]);
}
}
Which statement is corrected?
Givethefollowingjavaclass:
publicclassExample{
staticintx[]=newint[15];
publicstaticvoidmain(Stringargs[]){
System.out.println(x[5]);
}
}
Whichstatementiscorrected?
A.Whencompile,someerrorwilloccur.
B.Whenrun,someerrorwilloccur.
C.Outputiszero.
D.Outputisnull.
4:
Give the following java source fragement:
//point x
public class Interesting{
//do something
}
Which statement is correctly Java syntax at point x?
Givethefollowingjavasourcefragement:
//pointx
publicclassInteresting{
//dosomething
}
WhichstatementiscorrectlyJavasyntaxatpointx?
A.publicclassMyClass{//dootherthing…}
B.staticintPI=3.14
C.classMyClass{//dosomething…}
D.none
5:
What will be the result of executing the following code?
boolean a = true;
boolean b = false;
boolean c = true;
if (a == true)
if (b == true)
if (c == true) System.out.println("Some things are true in this world");
else System.out.println("Nothing is true in this world!
");
else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false");
else System.out.println("Hey this won't compile");
Choices:
Whatwillbetheresultofexecutingthefollowingcode?
booleana=true;
booleanb=false;
booleanc=true;
if(a==true)
if(b==true)
if(c==true)System.out.println("Somethingsaretrueinthisworld");
elseSystem.out.println("Nothingistrueinthisworld!
");
elseif(a&&(b=c))System.out.println("It'stooconfusingtotellwhatistrueandwhatisfalse");
elseSystem.out.println("Heythiswon'tcompile");
Choices:
A.Thecodewon'tcompile
B."Somethingsaretrueinthisworld"willbeprinted
C."Heythiswon'tcompile"willbeprinted
D.Noneofthese
6:
What will be the result of executing the following code?
// Filename; SuperclassX.java
package packageX;
public class SuperclassX
{
protected void superclassMethodX()
{
}
int superclassVarX;
}
// Filename SubclassY.java
1.package packageX.packageY;
2.
3.public class SubclassY extends SuperclassX
4.{
5.SuperclassX objX = new SubclassY();
6.SubclassY objY = new SubclassY();
7.void subclassMethodY()
8.{
9.objY.superclassMethodX();
10.int i;
11.i = objY.superclassVarX;
12.}
13.}
Choices:
Whatwillbetheresultofexecutingthefollowingcode?
//Filename;SuperclassX.java
packagepackageX;
publicclassSuperclassX
{
protectedvoidsuperclassMethodX()
{
}
intsuperclassVarX;
}
//FilenameSubclassY.java
1.packagepackageX.packageY;
2.
3.publicclassSubclassYextendsSuperclassX
4.{
5.SuperclassXobjX=newSubclassY();
6.SubclassYobjY=newSubclassY();
7.voidsubclassMethodY()
8.{
9.objY.superclassMethodX();
10.inti;
11.i=objY.superclassVarX;
12.}
13.}
Choices:
A.Compilationerroratline5
B.Compilationerroratline9
C.Runtimeexceptionatline11
D.Noneofthese
7:
在下述选项时,没有构成死循环的程序是
A.inti=100while
(1){i=i%100+1;if(i>100)break;}
B.for(;;);
C.intk=1000;do{++k;}while(k>=10000);
D.ints=36;while(s);--s;
8:
WhichfragmentsarenotcorrectinJavasourcefile?
A.packagetestpackage;publicclassTest{//dosomething...}
B.importjava.io.*;packagetestpackage;publicclassTest{//dosomething...}
C.importjava.io.*;classPerson{//dosomething...}publicclassTest{//dosomething...}
D.importjava.io.*;importjava.awt.*;publicclassTest{//dosomething...}
9:
下述程序代码中有语法错误的行是( )。
int i,ia[10],ib[10]; /*第一行*/
for (i=0;i<=9;i++) /*第2行*/
ia[i]=0; /*第3行*/
ib=ia; /*第4行*/
下述程序代码中有语法错误的行是()。
inti,ia[10],ib[10];/*第一行*/
for(i=0;i<=9;i++)/*第2行*/
ia[i]=0;/*第3行*/
ib=ia;/*第4行*/
A.第1行
B.第2行
C.第3行
D.第4行
10:
在软件生命周期中,下列哪个说法是不准确的?
A.软件生命周期分为计划、开发和运行三个阶段
B.在计划阶段要进行问题焉醛和需求分析
C.在开发后期要进行编写代码和软件测试
D.在运行阶段主要是进行软件维护
11:
下面关于变量及其范围的陈述哪些是错的。
A.实例变量是类的成员变量。
B.实例变量用关键字static声明。
C.在方法中定义的局部变量在该方法被执行时创建
D.局部变量在使用前必须被初始化。
12:
Whichmodifiershouldbeap
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 海神 软件有限公司