易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

public class Pass {  public static void main(String [1 args) {  int x 5;  Pass p = new Pass();  p.doStuff(x);  System.out.print(” main x = “+ x);  }  void doStuff(int x) {  System.out.print(” doStuff x = “+ x++);  }  }  What is the result?() 

A、 Compilation fails.

B、 An exception is thrown at runtime.

C、 doStuffx = 6 main x = 6

D、 doStuffx = 5 main x = 5

E、 doStuffx = 5 main x = 6

F、 doStuffx = 6 main x = 5

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • 35. String #name = “Jane Doe”;  36. int$age=24;  37. Double_height = 123.5;  38. double~temp = 37.5;  Which two are true?()

    A

     Line 35 will not compile.

    B

     Line 36 will not compile.

    C

     Line 37 will not compile.

    D

     Line 38 will not compile.

  • public void test(int x) {  int odd = x%2;  if (odd) {   System.out.println(“odd);  } else {  System.out.println(“even”);  }  }  Which statement is true?() 

    A、Compilation fails.

    B、 “odd” will always be output.

    C、 “even” will always be output.

    D、 “odd” will be output for odd values of x, and “even” for even values.

    E、 “even” will be output for add values of x, and “odd” for even values.

  • What is the result?()

    A、 end

    B、 Compilation fails.

    C、 exception end

    D、 exception test end

    E、 A Throwable is thrown by main.

    F、 An Exception is thrown by main.

  • public class ForBar {   public static void main(String args) {   int i = 0, j = 5;   tp: for (;;) {   i ++;   for(;;)   if(i > --j) break tp;   }   system.out.printIn(“i = ” + i + “, j = “+ j);   }   }   What is the result? () 

    A、 The program runs and prints “i=1, j=0”

    B、 The program runs and prints “i=1, j=4”

    C、 The program runs and prints “i=3, j=4”

    D、 The program runs and prints “i=3, j=0”

    E、 An error at line 4 causes compilation to fail.

    F、 An error at line 7 causes compilation to fail.

  • class One {  public One() { System.out.print(1); }  }  class Two extends One {  public Two() { System.out.print(2); }  }  class Three extends Two {  public Three() { System.out.print(3); }  }  public class Numbers{  public static void main( String[] argv) { new Three(); }  }  What is the result when this code is executed?() 

    A、 1

    B、 3

    C、 123

    D、 321

    E、 The code rims with no output.

联系客服 会员中心
TOP