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

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