网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   And command line invocation:  Java Test red green blue  What is the result? ()
A

 Baz has the value of “”

B

 Baz has the value of null

C

 Baz has the value of “red”

D

 Baz has the value of “blue”

E

 Bax has the value of “green”

F

 The program throws an exception.


参考答案

参考解析
解析: 暂无解析
更多 “单选题public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   And command line invocation:  Java Test red green blue  What is the result? ()A  Baz has the value of “”B  Baz has the value of nullC  Baz has the value of “red”D  Baz has the value of “blue”E  Bax has the value of “green”F  The program throws an exception.” 相关考题
考题 下列程序段的输出结果是【 】。public class Test {void printValue(int m) {do {System.out.println("The value is"+m);}while (--m>10);}public static void main (String args[]) {int i=10;Test t= new Test();t.printValue(i);}}

考题 下列语句输出结果为( )。public class test{public static void main(String args[]){byte b=OXA;System.out.println(b);}}A.OXAB.AC.1D.10

考题 下列程序的运行结果是【 】。public class Test {public static void main (String args[]) {String s1="hello!";System.out.println (s1.toUpperCase());}}

考题 下列代码的执行结果是( )。 public class Test { public static void main(String args[]) { System.out.println(7/2); } }A.3.5B.3C.3.0D.3.50

考题 ( 8 )阅读下列代码public class Test2{public static void main(String args[]){System.out.println(5/2);}}其执行结果是 【 8 】 。

考题 请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”Class Test 【 15 】 {Public static void main (String[] arge){Test t = new Test();t.start();}Public void run(){System.out.println( “ Hello! ” );}

考题 已知如下类说明: public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); // 程序代码… } } 如下哪个使用是正确的?() A.t.fB.this.nC.Test.mD.Test.n

考题 下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new TeA.0B.1C.2D.3

考题 下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

考题 以下程序调试结果为:public class Test {int m=5;public void some(int x) {m=x;}public static void main(String args []) {new Demo().some(7);}}class Demo extends Test {int m=8;public void some(int x) {super.some(x);System.out.println(m);}}A.5B.8C.7D.无任何输出E.编译错误

考题 class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()  A、 Compilation succeeds and 4 is printed.B、 Compilation succeeds and 43 is printed.C、 An error on line 9 causes compilation to fail.D、 An error on line 14 causes compilation to fail.E、 Compilation succeeds but an exception is thrown at line 9.

考题 Which declarations will allow a class to be started as a standalone program?()  A、public void main(String args[])B、public void static main(String args[])C、public static main(String[] argv)D、final public static void main(String [] array)E、public static void main(String args[])

考题 package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?() A、 x = 0B、 x = 42C、 Compilation fails because of an error in line 2 of class Test2.D、 Compilation fails because of an error in line 3 of class Test1.E、 Compilation fails because of an error in line 4 of class Test2.

考题 Public class test (  Public static void main (String args[])  (  System.out.printIn (6 ^ 3);  )  )   What is the output?()

考题 Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”);  StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  BufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  )  )   What is the output?()

考题 下列有关main()方法的签名正确的是哪些?()A、 public static void main(String[] args){}B、 public static void main(){}C、 public static void main(String args[]){}D、 public void static main(String[] args){}

考题 下面关于Java应用程序中main方法的写法,合法的是()。A、public static void main()B、public static void main(Stringargs[])C、public static int main(String[]arg)D、public void main(Stringarg[])

考题 作为类中新线程的开始点,线程的执行是从()方法开始的。A、public void start()B、public void run()C、public void int()D、public static void main(Stringargs[])

考题 public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()  A、 0B、 1C、 2D、 Compilation fails.

考题 public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?() A、The program runs and prints “Hello”B、An error causes compilation to fail.C、The program runs and prints “Hello world!”D、The program runs but aborts with an exception.

考题 public class test(   public static void main(stringargs){   string foo = args [1];   string foo = args ;   string foo = args ;   }   )   And command line invocation:  Java Test red green blue  What is the result? () A、 Baz has the value of “”B、 Baz has the value of nullC、 Baz has the value of “red”D、 Baz has the value of “blue”E、 Bax has the value of “green”F、 The program throws an exception.

考题 下面哪些main方法可用于程序执行()A、public static void main(String[]args)B、public static void main(String[]x)C、public static void main(Stringargs[])D、public void main(String[]args)

考题 单选题public class Test {   public static void main (Stringargs) {   String foo = args[1];   String bar = args;   String baz = args;   System.out.printIn(“baz = ” + baz);  }   }   And the output:  Baz = 2   Which command line invocation will produce the output?()A  Java Test 2222B  Java Test 1 2 3 4C  Java Test 4 2 4 2D  Java Test 4 3 2 1

考题 单选题class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()A  Compilation succeeds and 4 is printed.B  Compilation succeeds and 43 is printed.C  An error on line 9 causes compilation to fail.D  An error on line 14 causes compilation to fail.E  Compilation succeeds but an exception is thrown at line 9.

考题 单选题public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()A  0B  1C  2D  Compilation fails.

考题 填空题Public class test (    Public static void main (String args) (   System.out.printIn (6^3);   )   )   What is the output? ()

考题 填空题Public class test (    Public static void stringReplace (String text) (    Text = text.replace („j„ , „i„);    )      public static void bufferReplace (StringBuffer text) (    text = text.append (“C”)   )      public static void main (String args ){  String textString = new String (“java”);    StringBuffer text BufferString = new StringBuffer (“java”);      stringReplace (textString);    BufferReplace (textBuffer);      System.out.printIn (textString + textBuffer);    }   )   What is the output?()