更多“问答题What is the value of the variable output at line 24?”相关问题
  • 第1题:

    package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()

    • A、any class
    • B、only the Target class
    • C、any class in the test package
    • D、any class that extends Target

    正确答案:C

  • 第2题:

    public class X {   public static void main (Stringargs) {   int a = new int [1]   modify(a);   System.out.printIn(a[0]);   }   public static void modify (int a) {   a[0] ++;    }    }   What is the result?()  

    • A、 The program runs and prints “0”
    • B、 The program runs and prints “1”
    • C、 The program runs but aborts with an exception.
    • D、 An error “possible undefined variable” at line 4 causes compilation to fail.
    • E、 An error “possible undefined variable” at line 9 causes compilation to fail.

    正确答案:B

  • 第3题:

    What is the most likely problem with this script () VAR=1   ((VAR=$VAR+1))    while [ $VAR -It 10 ]    do   echo $VAR  done

    • A、#!/bin/ksh line is missing
    • B、Variable name VAR is not properly initialized
    • C、Loop variable is not incremented inside the loop
    • D、Replace brackets with braces

    正确答案:C

  • 第4题:

    12. Date date = new Date();  13. df.setLocale(Locale.ITALY);  14. String s = df.format(date);  The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?() 

    • A、 The value of s is 14-dic-2004.
    • B、 The value of s is Dec 14, 2000.
    • C、 An exception is thrown at runtime.
    • D、 Compilation fails because of an error in line 13.

    正确答案:D

  • 第5题:

    11. public void someMethod(Object value) {  12. // check for null value ....  20. System.out.println(value.getClass());  21. }  What, inserted at line 12, is the appropriate way to handle a null value?() 

    • A、 assert value == null;
    • B、 assert value !null, “value is null”;
    • C、 if (value == null) { throw new AssertionException(”value is null”);
    • D、 if (value == null) { throw new IllegalArgumentException(”value is null”);

    正确答案:D

  • 第6题:

    Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()

    • A、assert value == null;
    • B、assert value != null, "value is null";
    • C、if (value == null) { throw new AssertionException("value is null"); }
    • D、if (value == null) { throw new IllegalArgumentException("value is null"); }

    正确答案:D

  • 第7题:

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

    Compilation fails due to an error in line 23.

    B

    Compilation fails due to an error in line 29.

    C

    A ClassCastException occurs in line 29.

    D

    A ClassCastException occurs in line 31.

    E

    The value of all four objects prints in natural order.


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

  • 第8题:

    多选题
    Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()
    A

    The value of an int is undetermined.

    B

    The value of all numeric types is zero.

    C

    The compiler may issue an error if the variable is used before it is initialized.

    D

    The value of a String variable is  (empty string).

    E

    The value of all object variables is null.


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

  • 第9题:

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

    X, followed by an Exception.

    B

    No output, and an Exception is thrown.

    C

    Compilation fails due to an error on line 14.

    D

    Compilation fails due to an error on line 16.

    E

    Compilation fails due to an error on line 17.


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

  • 第10题:

    单选题
    What does it mean for a variable in the Application Editor to be defined as a parameter?()
    A

    The variable can be used to pass data to and from subflows.  

    B

    The value for that variable can be supplied via Application Configuration in Application Administration.  

    C

    The value for that variable is defined by the calling application.  

    D

    The variable can be used in conditional steps.  

    E

    The variable can be used to pass data to and from VoiceXML applications.


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

  • 第11题:

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

    The code runs with no output.

    B

    An exception is thrown at runtime.

    C

    Compilation fails because of an error in line 20.

    D

    Compilation fails because of an error in line 21.

    E

    Compilation fails because of an error in line 23.

    F

    Compilation fails because of an error in line 25.


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

  • 第12题:

    单选题
    12. Date date = new Date();  13. df.setLocale(Locale.ITALY);  14. String s = df.format(date);  The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
    A

     The value of s is 14-dic-2004.

    B

     The value of s is Dec 14, 2000.

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 13.


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

  • 第13题:

    Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()  

    • A、The value of an int is undetermined.
    • B、The value of all numeric types is zero.
    • C、The compiler may issue an error if the variable is used before it is initialized.
    • D、The value of a String variable is "" (empty string).
    • E、The value of all object variables is null.

    正确答案:B,E

  • 第14题:

    What does it mean for a variable in the Application Editor to be defined as a parameter?()

    • A、The variable can be used to pass data to and from subflows.  
    • B、The value for that variable can be supplied via Application Configuration in Application Administration.  
    • C、The value for that variable is defined by the calling application.  
    • D、The variable can be used in conditional steps.  
    • E、The variable can be used to pass data to and from VoiceXML applications.

    正确答案:B

  • 第15题:

    1. public class Test { 2. public static String output =””; 3.  4. public static void foo(int i) { 5. try { 6. if(i==1) { 7. throw new Exception(); 8. } 9. output += “1”; 10. } 11. catch(Exception e) { 12. output += “2”; 13. return; 14. } 15. finally { 16. output += “3”;17. } 18. output += “4”; 19. } 20.  21. public static void main(String args[]) { 22. foo(0); 23. foo(1); 24.  25. }26. } What is the value of the variable output at line 23?()


    正确答案:13423

  • 第16题:

    public class SwitchTest {   public static void main (String args) {   System.out.PrintIn(“value =” +switchIt(4));   }   public static int switchIt(int x) {   int j = 1;   switch (x) {   case 1: j++;   case 2: j++;   case 3: j++;  case 4: j++;   case 5: j++;   default:j++;   }   return j + x;   }   }   What is the output from line 3? ()

    • A、 Value = 3
    • B、 Value = 4
    • C、 Value = 5
    • D、 Value = 6
    • E、 Value = 7
    • F、 Value = 8

    正确答案:F

  • 第17题:

    1. public class test {  2. public static string output = “”  3.    4. public static void foo(int i) {  5. try {  6. if(i= =1) {  7. throw new Exception ();  8. }  9. output += “1”;  10.}  11. catch(Exception e)  {  12. output += “2”;  13. return;  14.}  15. finally (  16. output += “3”;  17. )  18. output += “4”;  19. } 20.    21. public static void main (string args[])  (  22. foo(0);  23. foo(1);  24.    25. )  26. } What is the value of the variable output at line 24?()


    正确答案:13423

  • 第18题:

    单选题
    Given the following script, why does the output come out as an empty line instead of "dog"?()
    A

    The $VAR variable was not exported

    B

    The $VAR should have been set as VAR

    C

    dog needs double quotes around it when setting $VAR

    D

    The { } should not be around VAR in the echo command


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

  • 第19题:

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

    B

    B

    B, followed by an Exception.

    C

    Compilation fails due to an error on line 9.

    D

    Compilation fails due to an error on line 14.

    E

    An Exception is thrown with no other output.


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

  • 第20题:

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

    Compilation of class A fails.

    B

    Line 28 prints the value 3 to System.out.

    C

    Line 28 prints the value 1 to System.out.

    D

    A runtime error occurs when line 25 executes.

    E

    Compilation fails because of an error on line 28.


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

  • 第21题:

    单选题
    What is the result?()
    A

    Compilation of class A fails.

    B

    Line 28 prints the value 3 to System.out.

    C

    Line 28 prints the value 1 to System.out.

    D

    A runtime error occurs when line 25 executes.

    E

    Compilation fails because of an error on line 28.


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

  • 第22题:

    单选题
    11. public void someMethod(Object value) {  12. // check for null value ....  20. System.out.println(value.getClass());  21. }  What, inserted at line 12, is the appropriate way to handle a null value?()
    A

     assert value == null;

    B

     assert value !null, “value is null”;

    C

     if (value == null) { throw new AssertionException(”value is null”);

    D

     if (value == null) { throw new IllegalArgumentException(”value is null”);


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

  • 第23题:

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

    B

    B

    The code runs with no output.

    C

    Compilation fails because of an error in line 12.

    D

    Compilation fails because of an error in line 15.

    E

    Compilation fails because of an error in line 18.


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