单项选择题

阅读下列代码后 public class Person{ int arr[]=new int[10]; public static void main(String args[]){ System.out.println(arr[1]); } } 正确的说法是( )。

A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的功能是在监控台上每隔一秒钟显示一个字符串 Hello! ,能够填写在程序中下划线位置,使程序完整并能正确运行的语句是( )。 public class Test implements Runnable{ public static void main(String args[]){ Test t=new Test(); Thread tt=new Thread(t); tt.start(); } public void run(){ for(;;){ try{ ________; }catch(______e){} System.out.println( Hello ); } } }
A.sleep(1000) InterruptedException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1000) RuntimeException
D.Thread.sleep(1000) InterruptedException
单项选择题
在匹配器(Matcher)类中,用于输入字符串与模式串比较的方法是( )。
A.static boolean matches()
B.boolean matcher.find()
C.int matcher.start()
D.int matcher.end()
相关试题
  • 下列有关Java语言的叙述中,正确的是( )...
  • 按照“先进先出”原则组织数据的数据结构是...
  • 请写出下面程序的运行结果: public clas...
  • 请阅读下列程序代码,然后将程序的执行结果...
  • Swing的事件处理机制包括【 】、事件和事...