(String[] args)
| 6 | |
| 7 | public class SetOfInteger { |
| 8 | public static void main(String[] args) { |
| 9 | Random rand = new Random(47); |
| 10 | Set<Integer> intset = new HashSet<>(); |
| 11 | for(int i = 0; i < 10000; i++) |
| 12 | intset.add(rand.nextInt(30)); |
| 13 | System.out.println(intset); |
| 14 | } |
| 15 | } |
| 16 | /* Output: |
| 17 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |