Search This Blog

Monday, January 25, 2010

Discard duplicate items from Array or List using Set

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Main {
public static void main(String[] argv) throws Exception {
int[] arr = new int[5];

Set set = new HashSet(Arrays.asList(arr));
}
}

No comments:

Post a Comment

Thanks for your comment, will revert as soon as we read it.

Popular Posts