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);
}
网友评论