计算机二级习题练习

计算机二级考试Java每日一练(2015-11-26)
1题:能够支持javadoc命令的注释语句是()。
  
A./**…//
B./*…*/
C.//
D./**…*/
【单选题】:      

2题:下列表达式中,类型可以作为int型的是(    )。
A."abc"+"efg"    
B."abc"+’ef9’
C.’a’+’b’
D.3+"4"
【单选题】:      

3题:按照Java的标识符命名规则,下列表示一个类的标识符正确的是()。
A.Helloworld
B.HelloWorld
C.helloworld
D.helloWorld
【单选题】:      

4题:下列程序的输出结果是(      )。 
Public class Test{
Public static void main(String[]args){
int[]array=(2,4,6,8,10); 
int size=6; 
int result=-l: 
try{
for(int i=0;iif(array[i]= =20)result=i: 
}
catch(ArithmeticException e){
System.out.println("Catch---1"); 
}
catch(ArraylndexOutOfBoundsException e){
System.out.println("Catch---2"): 
}
catch(Exception e){
System.out.println("Catch---3"): 
}
}
A.Catch---1 
B.Catch---2
C.Catch---3 
D.以上都不对
【单选题】:      

5题:以下程序的输出结果是______。
  main()
  { int a=3,b=2,c=1;
  c-=++b;
  b*=a+c;
  { int b=5,c=12;
  c/=b*2;
  a-=c;
  printf("%d,%d,%d",a,b,c);
  a+=--c;
  }
  printf("%d,%d,%d\\n",a,b,c);
  }
 
【填空题】:

6题:数据库设计包括两个方面的设计内容,它们是(      )。 
A.概念设计和逻辑设计 
B.模式设计和内模式设计 
C.内模式设计和物理设计 
D.结构特性设计和行为特性设计
【单选题】:      

7题:在创建线程时可以显式地指定线程组,此时可供选择的线程构造方法有(      )种。 
A.1 
B.2
C.3 
D.4 
【单选题】:      

8题:下面程序段的输出结果是()。


  publicclassTest{


  publicstaticvoidmain(Stringargs[]){


  intX,y;


  x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2;


  y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2;


  if(x>v)


  System.OUt.println("x>y");


  elseif(x==y)


  System.out.println("x=Y");


  else


  System.out.println("x  }


  }
A.x>y
B.x=Y
C.x  
D.编译错误
【单选题】:      

9题:下列关于Applet的叙述中,正确的是(      )。 
A.为了使Applet在浏览器中运行,需要在HTML文件中嵌入相应的Applet类
B.Applet不能从外部接收参数 
C.Applet不能使用javac命令进行编译 
D.Java Application与Applet都必须包含main()方法 
【单选题】:      

10题:下列程序的功能是在监控台上每隔一秒钟显示一个字符串”Hello!”,能够填写在程序中下画线位置,使程序完整并能正确运行的语句是( )。
  public class Test implements Runnable{
  public static void main(String args[]){
  Test t=new Test():
  Threadt t=new Thread(t);
  tt.start():
  }
  public void run(){
  for(;;){
  try{
  ;
  }catch(e){}
  System.out.println("Hello");
  }
  }
  }
  A.sleep(1000) B.t.sleep(1000)
  InterruptedExceptionInterruptedException
  C.Thread.sleep(1000)D.Thread.sleep(1000)
  RuntimeExceptionInterruptedException
【单选题】:      

 

您正在结束答题

请确认是否提交试卷?

继续做题 确认提交