I try to print simple HashSet in java 20 without success what am i missing here ?
public static void main(String[] args) {
int[] a1 = {1,3,6,8,10,11,14,17,21};
int[] a2 = {2,4,8,9,12,14,15};
HashSet<int[]> result = new HashSet<>(Arrays.asList(a1));
Iterator<int[]> it = result.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
System.out.println(result.toString());
}
}

To get a string representation of an array you can use
Arrays.toString():Output: