填空题

以下代码的运行结果是______。
public class exl4
{
public static void main(String args [])
{
int i = O;
while(i < 10)
{
i++;
if(i == 5)
continue;
}
System.out.println(i);
}
}

【参考答案】

10
<上一题 目录 下一题>
热门 试题

填空题
通过实现Runnable接口创建线程,请在画线处加入正确的代码完成此程序______。public class ThreadTest{public static void main(String args[ ]){Thread t1=new Thread(new Hello());Thread t2=new Thread(new Hello());______;t2.start();}}class Hello implements Runnable{int i;public void run(){while(true){System.out.println( Hello +i++);if(i==5) break;}}}
填空题
请阅读下列程序代码,然后将程序的执行结果补充完整。程序代码:public class throwsException{static void Proc(int sel)throws ArithmeticException, ArrayIndexOutOfBoundsExceptionSystem.out.println( In Situation +sel);if(sel==0){System.out.println( no Exception caught );return;}else if(sel==1){int iArray[]=new int[4];iArray[1]=3;}}public static void main(String args[]){try{Proc(0);Proc(1);}catch (ArrayIndexOutOfBoundsException e){System.out.println( Catch +e);}finally{System.out.println( in Proc finally );}}}执行结果In Situation 0no Exception caught______in Proc finally
相关试题
  • ______语句的功能是从当前方法中退出...
  • 函数min()的功能是:在带头结点的单链表...
  • 下列JApplet使用重写paintCompon6t()方...
  • ______类是提供线程操作和管理的类。
  • 请在下画线中填写适当内容:abstract clas...