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

题目内容 (请给出正确答案)
单选题
Given:  310-025   Leading the way in IT testing and certification tools, www.testking.com   - 48 -   public class foo {   static String s;   public static void main (Stringargs) {   system.out.printIn (“s=” + s);   }   }   What is the result?()
A

 The code compiles and “s=” is printed.

B

 The code compiles and “s=null” is printed.

C

 The code does not compile because string s is not initialized.

D

 The code does not compile because string s cannot be referenced.

E

 The code compiles, but a NullPointerException is thrown when toString is called.


参考答案

参考解析
解析: 暂无解析
更多 “单选题Given:  310-025   Leading the way in IT testing and certification tools, www.testking.com   - 48 -   public class foo {   static String s;   public static void main (Stringargs) {   system.out.printIn (“s=” + s);   }   }   What is the result?()A  The code compiles and “s=” is printed.B  The code compiles and “s=null” is printed.C  The code does not compile because string s is not initialized.D  The code does not compile because string s cannot be referenced.E  The code compiles, but a NullPointerException is thrown when toString is called.” 相关考题
考题 下面程序的输出结果是什么? class Foo{ static void change(String s){ s=s.replace('j','l'); } public static void main(String args[]){ String s="java"; change(s); System.out.println(s); } }()A.lavaB.javaC.编译错误D.运行时出现异常

考题 public class foo {   public static void main (Stringargs) {  String s;   system.out.printIn (“s=” + s);   }   }   What is the result?()A、 The code compiles and “s=” is printed.B、 The code compiles and “s=null” is printed.C、 The code does not compile because string s is not initialized.D、 The code does not compile because string s cannot be referenced.E、 The code compiles, but a NullPointerException is thrown when toString is called.

考题 public class Test {   public static void main (String args) {  string foo = “blue”;  string bar = foo;   foo = “green”;   System.out.printIn(bar);   }   }   What is the result?()  A、 An exception is thrown.B、 The code will not compile.C、 The program prints “null”D、 The program prints “blue”E、 The program prints “green”

考题 public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?() A、 foofoofoofoofooB、 foobarfoobarbarC、 foobarfoofoofooD、 foobarfoobarfooE、 barbarbarbarbarF、 foofoofoobarbarG、 foofoofoobarfoo

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

考题 interface DeclareStuff{  public static final int EASY = 3;  void doStuff(int t); }  public class TestDeclare implements DeclareStuff {  public static void main(String [] args) {  int x=5;  new TestDeclare().doStuff(++x);  }  void doStuff(int s) {  s += EASY + ++s;  System.out.println(”s “ + s);  }  }  What is the result?() A、 s 14B、 s 16C、 s 10D、 Compilation fails.E、 An exception is thrown at runtime.

考题 public class foo {   public static void main (stringargs)   try {return;}   finally {system.out.printIn(“Finally”);}   }     What is the result?()  A、 The program runs and prints nothing.B、 The program runs and prints “Finally”C、 The code compiles, but an exception is thrown at runtime.D、 The code will not compile because the catch block is missing.

考题 Given:  310-025   Leading the way in IT testing and certification tools, www.testking.com   - 48 -   public class foo {   static String s;   public static void main (Stringargs) {   system.out.printIn (“s=” + s);   }   }   What is the result?()A、 The code compiles and “s=” is printed.B、 The code compiles and “s=null” is printed.C、 The code does not compile because string s is not initialized.D、 The code does not compile because string s cannot be referenced.E、 The code compiles, but a NullPointerException is thrown when toString is called.

考题 public class foo {  public static void main (String[]args) {  String s;  system.out.printIn (“s=” + s);  }  }   What is the result?()  A、 The code compiles and “s=” is printed.B、 The code compiles and “s=null” is printed.C、 The code does not compile because string s is not initialized.D、 The code does not compile because string s cannot be referenced.E、 The code compiles, but a NullPointerException is thrown when toString is called.

考题 public class foo {  static String s;  public static void main (String[]args) {  system.out.printIn (“s=” + s);  } }  What is the result?()  A、 The code compiles and “s=” is printed.B、 The code compiles and “s=null” is printed.C、 The code does not compile because string s is not initialized.D、 The code does not compile because string s cannot be referenced.E、 The code compiles, but a NullPointerException is thrown when toString is called.

考题 public class X {   public static void main (Stringargs) {   String s1 = new String (“true”);   Boolean b1 = new Boolean (true);   if (s2.equals(b1)) {   System.out.printIn(“Equal”);   }   }   }   What is the result? () A、 The program runs and prints nothing.B、 The program runs and prints “Equal”C、 An error at line 5 causes compilation to fail.D、 The program runs but aborts with an exception.

考题  public class X {   public static void main (String[]args)   {   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 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 (String args) {   class Foo {   public int i = 3;  }   Object o = (Object) new Foo();   Foo foo = (Foo)o;   System.out.printIn(foo. i);  }   }   What is the result?()A  Compilation will fail.B  Compilation will succeed and the program will print “3”C  Compilation will succeed but the program will throw a ClassCastException at line 6.D  Compilation will succeed but the program will throw a ClassCastException at line 7.

考题 单选题Given:  310-025   Leading the way in IT testing and certification tools, www.testking.com   - 48 -   public class foo {   static String s;   public static void main (Stringargs) {   system.out.printIn (“s=” + s);   }   }   What is the result?()A  The code compiles and “s=” is printed.B  The code compiles and “s=null” is printed.C  The code does not compile because string s is not initialized.D  The code does not compile because string s cannot be referenced.E  The code compiles, but a NullPointerException is thrown when toString is called.

考题 单选题public class X {   public static void main (Stringargs) {   String s1 = new String (“true”);   Boolean b1 = new Boolean (true);   if (s2.equals(b1)) {   System.out.printIn(“Equal”);   }   }   }   What is the result? ()A  The program runs and prints nothing.B  The program runs and prints “Equal”C  An error at line 5 causes compilation to fail.D  The program runs but aborts with an exception.

考题 单选题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 X {   public static void main (String[]args)   {   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 foo {  public static void main (String[]args) {  String s;  system.out.printIn (“s=” + s);  }  }   What is the result?()A  The code compiles and “s=” is printed.B  The code compiles and “s=null” is printed.C  The code does not compile because string s is not initialized.D  The code does not compile because string s cannot be referenced.E  The code compiles, but a NullPointerException is thrown when toString is called.

考题 单选题public class foo {   public static void main (stringargs)   try {return;}   finally {system.out.printIn(“Finally”);}   }     What is the result?()A  The program runs and prints nothing.B  The program runs and prints “Finally”C  The code compiles, but an exception is thrown at runtime.D  The code will not compile because the catch block is missing.

考题 单选题public class foo {   public static void main (Stringargs) {  String s;   system.out.printIn (“s=” + s);   }   }   What is the result?()A  The code compiles and “s=” is printed.B  The code compiles and “s=null” is printed.C  The code does not compile because string s is not initialized.D  The code does not compile because string s cannot be referenced.E  The code compiles, but a NullPointerException is thrown when toString is called.

考题 单选题public class foo {  static String s;  public static void main (String[]args) {  system.out.printIn (“s=” + s);  } }  What is the result?()A  The code compiles and “s=” is printed.B  The code compiles and “s=null” is printed.C  The code does not compile because string s is not initialized.D  The code does not compile because string s cannot be referenced.E  The code compiles, but a NullPointerException is thrown when toString is called.

考题 单选题interface DeclareStuff{  public static final int EASY = 3;  void doStuff(int t); }  public class TestDeclare implements DeclareStuff {  public static void main(String [] args) {  int x=5;  new TestDeclare().doStuff(++x);  }  void doStuff(int s) {  s += EASY + ++s;  System.out.println(”s “ + s);  }  }  What is the result?()A  s 14B  s 16C  s 10D  Compilation fails.E  An exception is thrown at runtime.

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

考题 单选题public class Test {  public static void main (String [] args)  {  string foo = “blue”;  string bar = foo;  foo = “green”;  System.out.printIn(bar);  }  }   What is the result?()A  An exception is thrown.B  The code will not compile.C  The program prints “null”D  The program prints “blue”E  The program prints “green”

考题 单选题public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?()A  foofoofoofoofooB  foobarfoobarbarC  foobarfoofoofooD  foobarfoobarfooE  barbarbarbarbarF  foofoofoobarbarG  foofoofoobarfoo