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

题目内容 (请给出正确答案)

class TestReference{   public static void main(String[] args){   int x=2;   TestReference tr = new TestReference();   System.out.print(x);   tr.change(x);   System.out.print(x);  }   public void change(int num){   num = num + 1;  }  }   程序运行后的输出是哪项()?  

  • A、 23
  • B、 21
  • C、 22
  • D、 编译错误

参考答案

更多 “ class TestReference{   public static void main(String[] args){   int x=2;   TestReference tr = new TestReference();   System.out.print(x);   tr.change(x);   System.out.print(x);  }   public void change(int num){   num = num + 1;  }  }   程序运行后的输出是哪项()?  A、 23B、 21C、 22D、 编译错误” 相关考题
考题 A developer has created a web application that includes a servlet for each use case in the application.These servlets have become rather difficult to maintain because the request processing methods havebecome very large. There is also common processing code in many servlets because these use cases arevery similar. Which two design patterns can be used together to refactor and simplify this web application?()A、ProxyB、View HelperC、Front ControllerD、Session FacadeE、Business DelegateF、Model-View-Controller

考题 java关于异常处理机制的叙述哪些正确()。A、catch部分捕捉到异常情况时,才会执行finally部分B、当try区段的程序发生异常时,才会执行catch区段的程序C、在try区段不论程序是否发生错误及捕获到异常错误,都会执行finally部分D、以上都是

考题 如何创建包?在什么情况下需要在程序里创建包?

考题 以下关于linux操作系统中硬链接和软链接的描述,正确的是()。A、硬链接和软链接指向的inode的编号是一样的B、可以建立一个空文件的软链接C、linux操作系统可以对目录进行硬链接D、硬链接指向inode节点

考题 举例说明多态。

考题 public class Test {  public static void main(String[] args) {  int x = 0;  assert (x  0) ? “assertion failed” : “assertion passed”;  System.out.println(“Finished”);  }  }  What is the result?()  A、 finishedB、 Compilation fails.C、 An AssertionError is thrown and finished is output.D、 An AssertionError is thrown with the message “assertion failed”.E、 An AssertionError is thrown with the message “assertion passed”.

考题 在正方体上任取三个顶点连成三角形,则所得的三角形是直角非等腰三角形的概率为()。A、1/14B、4/7C、2/7D、3/7

考题 What will be written to the standard output when the following program is run?()   public class Qcb90 {   int a;   int b;   public void f() {  a = 0;   b = 0;   int[] c = { 0 };   g(b, c);   System.out.println(a + " " + b + " " + c[0] + " ");   }   public void g(int b, int[] c) {   a = 1;  b = 1;  c[0] = 1;  }   public static void main(String args[]) {   Qcb90 obj = new Qcb90();   obj.f();   }   }  A、0 0 0B、0 0 1C、0 1 0D、1 0 0E、1 0 1