Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

int [] to Integer[]

int[] data = {1,2,3,4,5,6,7,8,9,10};

// To boxed array
Integer[] what = Arrays.stream( data ).boxed().toArray( Integer[]::new );
Integer[] ever = IntStream.of( data ).boxed().toArray( Integer[]::new );

// To boxed list
List<Integer> you  = Arrays.stream( data ).boxed().collect( Collectors.toList() );
List<Integer> like = IntStream.of( data ).boxed().collect( Collectors.toList() )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #int
ADD COMMENT
Topic
Name
5+6 =