[单选题]

在执行下面这段Java程序时: public class Test { public static void main (String[] args) { String s1=args[0]; String s2=args[1]; String s3=args[2]; } }若编译程序后键入命令: java Test one two three,那么变量s1所引用的字符串为( )。

A.null

B.test

C.one

D.java

参考答案与解析:

相关试题

运行下面的程序时,会产生()。 public class Test{public

[单选题]运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y = 2/x; int z[ ] = {1,2,4,6}; int p=z[4]; } }A.ArrayIndexOutOfBoundsExcePtion异常B.NumberFormatException异常C.ArithmeticException异常D.ArithmeticException异常和Array

  • 查看答案
  • 执行下列程序时,会产生什么异常public class Test{public

    [单选题]执行下列程序时,会产生什么异常 public class Test{ public static void main(String args[]){ int d=101; int b=220; long a=321; System.out.println((a-B)/(a-b-D)); } }A.ArrayIndexOutOfBoundsExceptionB.NumberFormatExceptionC.ArithmeticExceptionD.EOFException

  • 查看答案
  • 执行下列程序时,会产生什么异常public class Test{public

    [单选题]执行下列程序时,会产生什么异常 public class Test{ public static void main(String args[]{ int d=101; int b=220; long a=321; System.out.println((a-b) /(a-b-d) ); } }A.ArraylndexOutOfBoundsExceptionB.NumberFormatExceptionC.ArithmeticExCeptionD.EOFException

  • 查看答案
  • 执行如下程序:public class Test {public static

    [单选题]执行如下程序: public class Test { public static void main (String args[]) { int x=1,a=0,b=0; switch (x) { case 0: b++; case 1: a++; case 2: a++;b++; } System.out.println("a=" +a ",b=" +b); } } 该程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

  • 查看答案
  • 执行下列程序时,会产生( )异常。 public class Test{publ

    [单选题]执行下列程序时,会产生( )异常。 public class Test{ public static void main(String args[ ]){ int d=101; int b=220; long a=321; System.out.println((a-b)/(a-b-d)); } }A.ArraylndexOutOfBoundsExceptionB.NumberFormatExceptionC.ArithmeticExceptionD.EOFExcepfion

  • 查看答案
  • 运行下面的程序时,会产生( )。 public class Test{publi

    [单选题]运行下面的程序时,会产生( )。 public class Test{ public static void main(String args[ ] ) { int x =0; int y = 2/x; int z[ ] = {1,2,4,6}; int p=z[4]; } }A.ArrayIndexOutOfBoundsExcePtion异常B.NumberFormatException异常C.ArithmeticException异常D.ArithmeticException异常和Array

  • 查看答案
  • 执行下列程序时,会产生什么异常 public class Test {publi

    [单选题]执行下列程序时,会产生什么异常 public class Test { public static void main(String args[ ])( int d=101; int b=220; long a=321; System.out.println((a-B) /(a-b-D) ); } }A.ArrayIndexOutOfBoundsExceptionB.NumberFormatExceptionC.ArithmetieExceptionD.EOFException

  • 查看答案
  • 请阅读下面程序public class Test {public static

    [主观题]请阅读下面程序public class Test {public static void main (String[] args) {int i,j;for (i=1;i<5;i++) {for (j=1;j<=i;j++)system.out.print (i+"X"+j+"="+i*j+" ");System.out.println();}}}程序执行完后,i循环和j循环执行的次数分别是[ ]。

  • 查看答案
  • 阅读下面程序public class Test2 ______ { public

    [单选题]阅读下面程序 public class Test2 ______ { public static void main(String[] args) { Thread t=new Test2(); t.start(); } public void run() { System.out.println("How are you."); } } 程序中下画线处应填入的正确选项是A.implements ThreadB.extends RunnableC.implements RunnableD.e

  • 查看答案
  • 执行下面程序后输出的正确结果是public class Test{public

    [单选题]执行下面程序后输出的正确结果是public class Test{ public static void main(String args[]){ System.out.print(100%3); System.out.print(","); System.out.print(100%3.0); }}A.1,1B.1,1.0C.1.0,1D.1.0,1.0

  • 查看答案
  • 在执行下面这段Java程序时:public class Test {public