Verify there is a combination of unique string

前端 未结 4 1892
忘了有多久
忘了有多久 2021-01-21 12:17
class Details{
 String name;
 String age;
 String email;
 String location;
}

1) If there is List of Details as in List

how
4条回答
  •  孤街浪徒
    2021-01-21 12:41

    Besides of using a hash as propposed by @OmG, you could also use a TreeSet with the key being a concatenation of the unique fields, also using a separator between them.

    A Set only admits unique keys.

提交回复
热议问题