且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我的列表中的所有值都相同?

更新时间:2023-11-28 16:07:16

您似乎过度使用静态".如果字段声明为静态,则该类的所有实例共享相同的副本,因此具有相同的值.检查您在 Card 类中查看的字段是否声明为静态",如果是,请将其删除.

You seem to be over-using "static". If a field is declared static, all instances of the class share the same copy, and so the same value. Check whether the fields you are looking at in the Card class are declared "static", and if so remove it.