【发布时间】:2015-03-19 15:50:46
【问题描述】:
package com.mkyong.test;
public class Main {
public static void main(String[] args) {
String something = "";
callSomething(something);
System.out.println(something);
}
private static String callSomething(String something) {
something = "Hello Wrold !";
return something;
}
}
【问题讨论】:
-
更改 callSomething(something); to something=callSomething(something);
-
字符串对象是不可变的
标签: java variables static scope main