public class Main { public static void main(String args[]) { String x = null; giveMeAString(x); System.out.println(x); } static void giveMeAString(String y) { y = "GeeksQuiz" ; } } |
(A) 极客问答 (B) 无效的 (C) 编译错误 (D) 例外 答复: (B) 说明: Java中的参数是按值传递的。因此,对y所做的更改不会反映在main()中。 这个问题的小测验
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END