单选题What will be the result of attempting to compile and run the following code?()   public class Q6b0c {   public static void main(String args[]) {  int i = 4;  float f = 4.3;   double d = 1.8;   int c = 0;   if (i == f) c++;   if (((int) (f + d)) == ((in

题目
单选题
What will be the result of attempting to compile and run the following code?()   public class Q6b0c {   public static void main(String args[]) {  int i = 4;  float f = 4.3;   double d = 1.8;   int c = 0;   if (i == f) c++;   if (((int) (f + d)) == ((int) f + (int) d))  c += 2;   System.out.println(c);   }   }
A

The code will fail to compile.

B

0 will be written to the standard output.

C

1 will be written to the standard output.

D

2 will be written to the standard output.

E

3 will be written to the standard output.


相似考题
更多“What will be the result of attempting to compile and run the”相关问题
  • 第1题:

    public class Foo {   public void main (String args) {   system.out.printIn(“Hello World.”);   }   }   What is the result? () 

    • A、 An exception is thrown.
    • B、 The code does no compile.
    • C、 “Hello World.” Is printed to the terminal.
    • D、 The program exits without printing anything.

    正确答案:A

  • 第2题:

    Which of the following best describes what is meant by Linux Affinity on AIX?()

    • A、The ability to install a Linux system on an AIX system
    • B、The ability to install an AIX system on a Linux system
    • C、The ability to compile and run a Linux application on AIX
    • D、The ability to compile and run an AIX application on Linux

    正确答案:C

  • 第3题:

    String foo = “blue”;    Booleanbar = new Boolean [1];    if (bar[0]) {    foo = “green”;    }   What is the result?()  

    • A、 Foo has the value of “”
    • B、 Foo has the value of null.
    • C、 Foo has the value of “blue”
    • D、 Foo has the value of “green”
    • E、 An exception is thrown.
    • F、 The code will not compile.

    正确答案:F

  • 第4题:

    Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()

    • A、If the compile is successful, Utils.class is added to the source directory.
    • B、The compiler returns an invalid flag error.
    • C、If the compile is successful, Utils.class is added to the classes directory.
    • D、If the compile is successful, Utils.class is added to the bigProject directory.

    正确答案:C

  • 第5题:

    单选题
    What will be the result of attempting to compile and run the following program?()   public class Q28fd {   public static void main(String args[]) {   int counter = 0;   l1:   for (int i=10; i i) break l2;   if (i == j) {   counter++;   continue l1;   }   }   counter--;   }   System.out.println(counter);  }   }
    A

    The program will fail to compile.

    B

    The program will not terminate normally.

    C

    The program will write 10 to the standard output.

    D

    The program will write 0 to the standard output.

    E

    The program will write 9 to the standard output.


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

  • 第6题:

    单选题
    What is the result( )?
    A

     The program prints “0”.

    B

     The program prints “4”.

    C

     The program prints “8”.

    D

     The program prints “12”.

    E

     The code does not compile.


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

  • 第7题:

    单选题
    Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()
    A

    If the compile is successful, Utils.class is added to the source directory.

    B

    The compiler returns an invalid flag error.

    C

    If the compile is successful, Utils.class is added to the classes directory.

    D

    If the compile is successful, Utils.class is added to the bigProject directory.


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

  • 第8题:

    单选题
    Which of the following best describes what is meant by Linux Affinity on AIX?()
    A

    The ability to install a Linux system on an AIX system

    B

    The ability to install an AIX system on a Linux system

    C

    The ability to compile and run a Linux application on AIX

    D

    The ability to compile and run an AIX application on Linux


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

  • 第9题:

    单选题
    11. class Converter {  12. public static void main(String[] args) {  13. Integer i = args[0];  14. int j = 12;  15. System.out.println(”It is “ + (j==i) + “that j==i.”);  16. }  17. }  What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
    A

     It is true that j==i.

    B

     It is false that j==i.

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 13.


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

  • 第10题:

    单选题
    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.


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

  • 第11题:

    单选题
    int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()
    A

     Foo has the value “”

    B

     Foo has the value null

    C

     An exception is thrown

    D

     The code will not compile


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

  • 第12题:

    What will be the result of attempting to compile and run the following code?()   public class Q6b0c {   public static void main(String args[]) {  int i = 4;  float f = 4.3;   double d = 1.8;   int c = 0;   if (i == f) c++;   if (((int) (f + d)) == ((int) f + (int) d))  c += 2;   System.out.println(c);   }   }  

    • A、The code will fail to compile.
    • B、0 will be written to the standard output.
    • C、1 will be written to the standard output.
    • D、2 will be written to the standard output.
    • E、3 will be written to the standard output.

    正确答案:A

  • 第13题:

    What will be the result of attempting to compile and run the following program?()   public class Q28fd {   public static void main(String args[]) {   int counter = 0;   l1:   for (int i=10; i<0; i--) {   l2:  int j = 0;   while (j < 10) {   if (j > i) break l2;   if (i == j) {   counter++;   continue l1;   }   }   counter--;   }   System.out.println(counter);  }   }   

    • A、The program will fail to compile.
    • B、The program will not terminate normally.
    • C、The program will write 10 to the standard output.
    • D、The program will write 0 to the standard output.
    • E、The program will write 9 to the standard output.

    正确答案:A

  • 第14题:

    int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()  

    • A、 Foo has the value “”
    • B、 Foo has the value null
    • C、 An exception is thrown
    • D、 The code will not compile

    正确答案:B

  • 第15题:

    单选题
    Click the Exhibit button.   What is the result?()
    A

     The code will deadlock.

    B

     The code may run with output "2 0 6 4".

    C

     The code may run with no output.

    D

     The code may run with output "0 6".

    E

     An exception is thrown at runtime.

    F

     The code may run with output "0 2 4 6".


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

  • 第16题:

    单选题
    String foo = “blue”;  Boolean[]bar = new Boolean [1];  if (bar[0])  {  foo = “green”;  }   What is the result? ()
    A

     Foo has the value of “”

    B

     Foo has the value of null.

    C

     Foo has the value of “blue”

    D

     Foo has the value of “green”

    E

     An exception is thrown.

    F

     The code will not compile.


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

  • 第17题:

    单选题
    What is the result?()
    A

     foo has the value””

    B

     foo has the value null.

    C

     An exception is thrown.

    D

     The code will not compile.


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

  • 第18题:

    单选题
    What will be the result of attempting to run the following program?()   public class Qaa75 {   public static void main(String args[]) {   String[][][] arr = {   { {}, null },   { { "1", "2" }, { "1", null, "3" } },   {},   { { "1", null } }  };   System.out.println(arr.length + arr[1][2].length);   }   }
    A

    The program will terminate with an ArrayIndexOutOfBoundsException.

    B

    The program will terminate with a NullPointerException.

    C

    4 will be written to standard output.

    D

    6 will be written to standard output.

    E

    7 will be written to standard output.


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

  • 第19题:

    单选题
    public class foo {  public static void main (string[]args)  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.


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

  • 第20题:

    单选题
    public class Foo {  public void main (String [] args)   {  system.out.printIn(“Hello World.”); } }  What is the result?()
    A

     An exception is thrown.

    B

     The code does no compile.

    C

     “Hello World.” Is printed to the terminal.

    D

     The program exits without printing anything.


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

  • 第21题:

    单选题
    int index = 1;   String test = new String;   String foo = test[index];  What is the result?()
    A

      Foo has the value “”

    B

     Foo has the value null

    C

     An exception is thrown

    D

     The code will not compile


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

  • 第22题:

    单选题
    What is the result()?
    A

     2

    B

     4

    C

     8

    D

     16

    E

     The code will not compile.


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