niusouti.com

单选题Given: What is the result?()AHelloBHello WorldCCompilation fails.DHello World 5EThe code runs with no output.FAn exception is thrown at runtime.

题目
单选题
Given: What is the result?()
A

Hello

B

Hello World

C

Compilation fails.

D

Hello World 5

E

The code runs with no output.

F

An exception is thrown at runtime.


相似考题
参考答案和解析
正确答案: B
解析: 暂无解析
更多“单选题Given: What is the result?()A HelloB Hello WorldC Compilation fails.D Hello World 5E The code runs with no output.F An exception is thrown at runtime.”相关问题
  • 第1题:

    public class Alpha{  public static void main( string[] args ){  if ( args.length == 2 ) {  if ( args.[0].equalsIgnoreCase(“-b”) )  System.out.println( new Boolean( args[1] ));  }  }  }   And the code is invoked by using the command: java Alpha –b TRUE   What is the result?()  

    • A、 true
    • B、 null
    • C、 false
    • D、 Compilation fails.
    • E、 The code runs with no output.
    • F、 An exception is thrown at runtime.

    正确答案:A

  • 第2题:

     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.

    正确答案:A

  • 第3题:

    String a = null;  a.concat(“abc”);  a.concat(“def”);  System.out.println(a);   What is the result?()  

    • A、 abc
    • B、 null
    • C、 abcdef
    • D、 Compilation fails.
    • E、 The code runs with no output.
    • F、 An exception is thrown at runtime.

    正确答案:F

  • 第4题:

    class Base {  Base() { System.out.print(“Base”); }  }  public class Alpha extends Base {  public static void main( String[] args ) {  new Alpha();  new Base();  }  }  What is the result?()  

    • A、 Base
    • B、 BaseBase
    • C、 Compilation fails.
    • D、 The code runs with no output.
    • E、 An exception is thrown at runtime.

    正确答案:B

  • 第5题:

    单选题
    10. public class Hello {  11. String title;  12. int value;  13. public Hello() {  14. title += “ World”;  15. }  16. public Hello(int value) {  17. this.value = value;  18. title = “Hello”;  19. Hello();  20. }  21. }  and:  30. Hello c = new Hello(5);  31. System.out.println(c.title);  What is the result?()
    A

     Hello

    B

     Hello World

    C

     Compilation fails.

    D

     Hello World 5

    E

     The code runs with no output.

    F

     An exception is thrown at runtime.


    正确答案: C
    解析: 暂无解析

  • 第6题:

    单选题
    Runnable r = new Runnable() {  public void run() {  System.out.print(”Cat”);  }  };  Threadt=new Thread(r) {  public void run() {  System.out.print(”Dog”);  }  };  t.start();  What is the result?()
    A

     Cat

    B

     Dog

    C

     Compilation fails.

    D

     The code runs with no output.

    E

     An exception is thrown at runtime.


    正确答案: B
    解析: 暂无解析

  • 第7题:

    单选题
    Click the Exhibit button. Given: ClassA a = new ClassA( ); a.methodA( ); What is the result? ()
    A

    Compilation fails.

    B

    ClassC is displayed.

    C

    The code runs with no output.

    D

    An exception is thrown at runtime.


    正确答案: B
    解析: 暂无解析

  • 第8题:

    单选题
    class Base {  Base() { System.out.print(“Base”); }  }  public class Alpha extends Base {  public static void main( String[] args ) {  new Alpha();  new Base();  }  }  What is the result?()
    A

     Base

    B

     BaseBase

    C

     Compilation fails.

    D

     The code runs with no output.

    E

     An exception is thrown at runtime.


    正确答案: C
    解析: 暂无解析

  • 第9题:

    单选题
    Given: What is the result?()
    A

    Hello

    B

    Hello World

    C

    Compilation fails.

    D

    Hello World 5

    E

    The code runs with no output.


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    Given: What is the result?()
    A

    peep

    B

    bark

    C

    meow

    D

    Compilation fails.

    E

    An exception is thrown at runtime.


    正确答案: E
    解析: 暂无解析

  • 第11题:

    单选题
    public class Alpha{  public static void main( string[] args ){  if ( args.length == 2 ) {  if ( args.[0].equalsIgnoreCase(“-b”) )  System.out.println( new Boolean( args[1] ));  }  }  }   And the code is invoked by using the command: java Alpha –b TRUE   What is the result?()
    A

     true

    B

     null

    C

     false

    D

     Compilation fails.

    E

     The code runs with no output.

    F

     An exception is thrown at runtime.


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    public class ClassA {  public int getValue() {  int value=0;  boolean setting = true;  String title=”Hello”;  (value || (setting && title == “Hello”)) { return 1; }  (value == 1 & title.equals(”Hello”)) { return 2; }  }  } And:  ClassA a = new ClassA();  a.getValue();  What is the result?()
    A

     1

    B

     2

    C

     Compilation fails.

    D

     The code runs with no output.

    E

     An exception is thrown at runtime.


    正确答案: D
    解析: 暂无解析

  • 第13题:

    Runnable r = new Runnable() {  public void run() {  System.out.print(”Cat”);  }  };  Threadt=new Thread(r) {  public void run() {  System.out.print(”Dog”);  }  };  t.start();  What is the result?() 

    • A、 Cat
    • B、 Dog
    • C、 Compilation fails.
    • D、 The code runs with no output.
    • E、 An exception is thrown at runtime.

    正确答案:B

  • 第14题:

    10. public class Hello {  11. String title;  12. int value;  13. public Hello() {  14. title += “ World”;  15. }  16. public Hello(int value) {  17. this.value = value;  18. title = “Hello”;  19. Hello();  20. }  21. }  and:  30. Hello c = new Hello(5);  31. System.out.println(c.title);  What is the result?() 

    • A、 Hello
    • B、 Hello World
    • C、 Compilation fails.
    • D、 Hello World 5
    • E、 The code runs with no output.
    • F、 An exception is thrown at runtime.

    正确答案:C

  • 第15题:

    public class ClassA {  public int getValue() {  int value=0;  boolean setting = true;  String title=”Hello”;  (value || (setting && title == “Hello”)) { return 1; }  (value == 1 & title.equals(”Hello”)) { return 2; }  }  } And:  ClassA a = new ClassA();  a.getValue();  What is the result?() 

    • A、 1
    • B、 2
    • C、 Compilation fails.
    • D、 The code runs with no output.
    • E、 An exception is thrown at runtime.

    正确答案:C

  • 第16题:

    单选题
    Given: What is the result?()
    A

    collie

    B

    harrier

    C

    Compilation fails.

    D

    collie harrier

    E

    An exception is thrown at runtime.


    正确答案: A
    解析: 暂无解析

  • 第17题:

    单选题
    Given: What is the result?()
    A

    r, t, t,

    B

    r, e, o,

    C

    Compilation fails.

    D

    An exception is thrown at runtime.


    正确答案: B
    解析: 暂无解析

  • 第18题:

    单选题
    String a = null;  a.concat(“abc”);  a.concat(“def”);  System.out.println(a);   What is the result?()
    A

     abc

    B

     null

    C

     abcdef

    D

     Compilation fails.

    E

     The code runs with no output.

    F

     An exception is thrown at runtime.


    正确答案: D
    解析: Exception in thread "main" java.lang.NullPointerException at X.main(X.java:12) 

  • 第19题:

    单选题
    Given: What is the result?()
    A

    TestA

    B

    TestB

    C

    Compilation fails.

    D

    An exception is thrown at runtime.


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    Given: What is the result?()
    A

     An exception is thrown at runtime.

    B

     int Long

    C

     Compilation fails.

    D

     Short Long


    正确答案: C
    解析: 暂无解析

  • 第21题:

    单选题
    Given: What is the result?()
    A

     An exception is thrown at runtime.

    B

     r, e, o,

    C

     Compilation fails.

    D

     r, t, t,


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    public class Foo {  public void main( String[] args ) {  System.out.println( “Hello” + args[0] );  }  }   What is the result if this code is executed with the command line?()
    A

     Hello

    B

     Hello Foo

    C

     Hello world

    D

     Compilation fails.

    E

     The code does not run.


    正确答案: E
    解析: 暂无解析

  • 第23题:

    单选题
    public class ClassA{ public int getValue(){ int value=0; boolean setting=true; String title="Hello"; if(value||(setting && title=="Hello")){return 1;} if(value==1&title.equals("Hello")){return 2;} } } And: ClassA a=new ClassA(); a.getValue(); What is the result?()
    A

    1

    B

    2

    C

    Compilation fails.

    D

    The code runs with no output.

    E

    An exception is thrown at runtime.


    正确答案: D
    解析: 暂无解析

  • 第24题:

    单选题
    Given: What is the result?()
    A

    Hello

    B

    Hello World

    C

    Compilation fails.

    D

    Hello World 5

    E

    The code runs with no output.

    F

    An exception is thrown at runtime.


    正确答案: E
    解析: 暂无解析