以下代码输出结果为:public class Main { public static void main(String args[]) { String x = null; giveMeAString(x); System.out.println(x); } static void giveMeAString(String y) { y = "RUNOOB"; } }
(A)RUNOOB
(B)null
(C)编程错误
(D)发生异常
参考答案
继续答题:下一题


更多java基础知识试题
- 1以下代码输出结果为:class Main {public static void swap(Integer i, Integer j) { Integer temp = new Integer(i); i = j; j = temp; } public static void main(String[] args) { Integer i = new Integer(10); Integer j = new Integer(20); swap(i, j); System.out.println("i = " + i + ", j = " + j); }}
- 2关键字( )表明一个对象或变量在初始化后不能修改
- 3下列关于构造函数的句子中,正确的是
- 4在创建对象时必须( )
- 5下面( )修饰符可以使一个类中的成员变量能被外部类调用。