Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get data from array list to set java

public void givenUsingCoreJava_whenListConvertedToSet_thenCorrect() {
    List<Integer> sourceList = Arrays.asList(0, 1, 2, 3, 4, 5);
    Set<Integer> targetSet = new HashSet<>(sourceList);
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #data #array #list #set #java
ADD COMMENT
Topic
Name
9+3 =