publicclassMyClass{/*Convert List to HashSet*/myHashSet=newHashSet<Integer>(myList);/*Convert HashSet to Array*/Object[]myArray=mySet.toArray();/*Convert List to TreeSet*/TreeSet<Integer>myTreeSet=newTreeSet<>(myList);}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.