int[]my_Array;my_Array=newint[5];for(intcount=0;count<=5;count++)System.out.println(my_Array[count]);结果是()A.将1,2,3,4,5输出到屏幕B.将0,1,2,3,4输出到屏幕C.将0,1,2,3,4,5输出到屏幕D.将出现运行时异常

题目
int[]my_Array;my_Array=newint[5];for(intcount=0;count<=5;count++)System.out.println(my_Array[count]);结果是()

A.将1,2,3,4,5输出到屏幕

B.将0,1,2,3,4输出到屏幕

C.将0,1,2,3,4,5输出到屏幕

D.将出现运行时异常


相似考题
更多“int[]my_Array;my_Array=newint[5];for(intcount=0;count&lt;=5;count++)System.out.println(my_Array[count]);结果是() ”相关问题
  • 第1题:

    Fordebuggingpurposes,youneedtorecordhowmanytimesagivenJSPisinvokedbeforetheuser’ssessionhasbeencreated.TheJSP’sdestroymethodstoresthisinformationtoadatabase.WhichJSPcodesnippetkeepstrackofthiscountforthelifetimeoftheJSPpage?()

    A.<%!intcount=0;%><%if(request.getSession(false)==null)count++;%>

    B.<%@intcount=0;%>.<%if(request.getSession(false)==null)count++;%>

    C.<%intcount=0;.if(request.getSession(false)==null)count++;%>

    D.<%@intcount=0;.if(request.getSession(false)==null)count++;%>

    E.<%!intcount=0;.if(request.getSession(false)==null)count++;%>


    参考答案:A

  • 第2题:

    读以下程序得到运行结果是______ #include<stdio.h> int main() { int k[30]={12,324,45,6}; int count=0,i=0; while(k[i]) { if(k[i]%2==0 || k[i]%5==0) count++; i++; } printf("%d,%dn",count,i); }


    emoclew emoclew

  • 第3题:

    39、给定如下Java代码片段,编译运行时,结果是() int [ ] a = {1,2,3,4,5}; for (int count = 0 ; count<5; count++) System.out.print(a[count++]) ;

    A.运行时出现异常

    B.输出:12345

    C.输出:24

    D.输出:135


    C

  • 第4题:

    下面程序的正确输出是( )。 public class Hello { public static void main(String args[]) { int count,xPos=25; for(count=1;count<=10;count++) { if(count= =5) Break; system.Out.println(count); xPos+=10: } } }

    A.1 2 3 4

    B.1 3 4

    C.编译错误

    D.以上都不正确


    正确答案:A
    A。【解析】该程序经过编译、运行后,在屏幕上显示:l234。publicclassHello中Hello为类名,publicstaticvoidmain(Stringargs[])有关参数的解释如下:public表示该方法可以被任意代码所调用,包括Java解释器;static告诉编译器,main方法是一个类方法,可以通过类名直接调用,调用时不需要该类的实例对象;void表示main方法没有返回值,这是非常重要的,因为Java类型检查非常严格,包括检查这些方法返回值的类型是否与声明的一致;Stringargs[]声明一个字符串类型的数组,它是命令行传递给main方法的参数,参数在命令行中出现在类名称后面。包含main方法的类(Hello为包含main方法的类名)名称必须与其文件名相同,也就是说,其文件名必须为Hello.java。经过编译,在当前文件夹下将出现一个Hello.class文件,这就是编译后的字节码文件。在程序段最后有两个大括号,分别说明结束main方法和Hello类。在本程序中由于有count==5这个条件判断,因此当count==5时,程序结束,输出为1234。

  • 第5题:

    给定如下Java代码片段,编译运行时,结果是() int [ ] a = {1,2,3,4,5}; for (int count = 0 ; count<5; count++) System.out.print(a[count++]) ;

    A.运行时出现异常

    B.输出:12345

    C.输出:135

    D.输出:24


    输出:135