62,634
社区成员




public static void main(String[] args) throws Exception {
final String str = "abcd";
System.out.println(str);
edit(str, "efgh");
System.out.println(str);
}
public static void edit(final String str, String newValue) throws Exception {
Field field = String.class.getDeclaredField("value");
field.setAccessible(true);
field.set(str, newValue.toCharArray());
}