how to make a set of array in java?

前端 未结 5 1571
醉梦人生
醉梦人生 2020-12-22 11:29

Since the equals function in array only check the instance, it doesn\'t work well with Set. Hence, I wonder how to make a set of arrays in java?

One possible way cou

5条回答
  •  盖世英雄少女心
    2020-12-22 12:31

    Don't use raw Arrays unless you absolutely have to because of some legacy API that requires an Array.

    Always try and use a type safe ArrayList instead and you won't have these kind of issues.

提交回复
热议问题