Java ArrayList和HashSet的区别 示例 1 : 是否有顺序 ArrayList: 有顺序 HashSet: 无顺序 HashSet的具体顺序,既不是按照插入顺序,也不是按照hashcode的顺序. 以下是HasetSet源代码中的部分注释 /** * It makes no guarantees as to the iteration order of the set; * in particular, it does not guarantee that the order…