相关考题

单项选择题 为将数组myArray的长度由3改为6,现采取以下编码:      int[]myArray=new int [3];      myArray=new  int[6];  代码执行后,以下叙述哪项是正确的?()

单项选择题 程序:  class    TestApp{  public  static void main (String[]  args){      int X=5:      switch (x){     case l:      case 2:      case 3:  System. out.println(“一季度”);      break;      case 4:      case 5: case 6:  System. out.println(“二季度”);     break;      default:  System. out.println(“三季度以上”);     break;     }     }     }  上述程序运行后的结果是哪项?()

单项选择题 已知数组array,其最后一个元素的下标是?()

多项选择题 下列有关数组的声明中,正确的是哪项?()

单项选择题 现有:      class TestApp{  public  static  void main (String[]  args){      int [5]   myarray={ 10, 11, 12, 13, 14);      int sum=0;  for (int x  :  myarray)     sum+=x;  System. out. println( "sum= "+sum);     }     }  上述程序运行后的结果是哪项?()

单项选择题 程序:  class   TestApp{  public  static  void main (String[]  args){     int x=6;     if (x>l)  System. out. println("x>l");     else if (x>5)  System. out .println("x>5");     else if (x<10)  System. out. println("xSystem. out .println( "x<29");     else  System. out.println(“以上都不是”);     }     }  上述程序运行后的结果是哪项?()

单项选择题 现有:     class TestApp{  public  static  void main (String[]  args){      for (int  i=0; iif(i==3)      break;  System. out .print (i);     }     }     }  程序运行后的输出是哪项?()

单项选择题 现有:  class  Test4  {  public static void main (String  []  args)  {    boolean X=true;   boolean y=false;    short Z=42;    if((z++==42)  &&  (y=true))z++;    if((x=false)  ||    (++z==45))  z++;    System. out.println(¨z=”+z);     }    }  结果为:()

单项选择题 基本数据类型float的包裹类是哪项?()

单项选择题 现有代码片段:      String  s="123";      String sl=S+456;  请问sl的结果是哪项?()

单项选择题 现有:      class Test2  f  public  static void main (String  []  args)  {      short a,b,C;      a=l;      b=2;  C=a+b;      a+=2:      }        以上代码中,哪一句是错误的?()

单项选择题 现有:  class  Wrench2  {      int size;  public static void main(String  []  args)  {      Wrench2 w=new Wrench2();      w.size=II;  Wrench2 w2=go(w, w.size);     System. out .print (w2. size);      }  static Wrench2 go(Wrench2 wr. int s)  {      S=12;  return wr;     }     } 结果为()

单项选择题 现有:  class Wrench f  public static void main(String  []  args)  {  Wrench w=new Wrench();    Wrench w2=new Wrench();     w2=go (w, w2);      System.out.print (w2==w);      }  static Wrench go (Wrench wrl,  Wrench wr2)  {     Wrench wr3=wrl; wrl=wr2; wr2=wr3;     return wr3;      }       结果是什么?()

单项选择题 现有:  class Passer f  static final int X=5;  public  static void main (String  []  args)  {      new  Passer().go (x);      System. out .print (x);      }  void go (int x)  {     System. out .print(x++);     }     结果是什么?()

单项选择题 现有:  class Top  {  static int x=l;  public Top (inty)  {  x*=3;  }      }  class Middle extends Top {      public Middle()  {x+=1;  )  public  static void main (String  []  args)  {      Middle m = new Middle();      System. out .println (x);      }     }      结果为:()

单项选择题 现有如下五个声明:  Linel: int a_really_really_really_long_variable_name=5 ;     Line2: int  _hi=6;  Line3:  int  big=Integer. getlnteger("7”);      Line4:int $dollars=8;      line5: int %opercent=9;      哪行无法通过编译?()

单项选择题 下列哪项不是Java语言的关键字?()

多项选择题 下列哪项是Java语言中所规定的注释样式?()

单项选择题 下列哪项不是有效的标识符?()

单项选择题 下列哪项不是int类型的字面量?()