You can fix the case above, where the called method modifies an object, by making the class immutable.

  • 你可以修正以上的例子,当被调用方法修改一个对象时,让这个类成为不可变的。
目录 查词历史