修改String 字符串
2018-05-17 本文已影响0人
牛马风情
public static void main(String[] args) throws Exception {
String s = "hello word";
Field va = String.class.getDeclaredField("value");
va.setAccessible(true);
char[] c = (char[]) va.get(s);
c[1] = 'A';
System.out.println(s);
}