有人可以向我解释下面的代码如何工作吗?目的是删除array中的重复值。我了解其中的一部分但不是全部
import java.util.Arrays;
import java.util.LinkedHashSet;
public class ArrayExample
{
public static void main(String[] args) throws `CloneNotSupportedException`
{
//Array with duplicate elements
Integer[] numbers = new Integer[] {1,2,3,4,5,1,3,5};
//This array has duplicate elements
System.out.println( Arrays.toString(numbers) );
//Create set from array elements
LinkedHashSet<Integer> linkedHashSet = new LinkedHashSet<>( Arrays.asList(numbers) );
//Get back the array without duplicates
Integer[] numbersWithoutDuplicates = linkedHashSet.toArray(new Integer[] {});
//Verify the array content
System.out.println( Arrays.toString(numbersWithoutDuplicates) );
}
}