Duplicate elements are discarded : HashSet « Collections Data Structure « Java
- Java
- Collections Data Structure
- HashSet
Duplicate elements are discarded
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] argv) throws Exception {
int[] array = new int[10];
Set set = new HashSet(Arrays.asList(array));
}
}
Related examples in the same category