Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

hwo to create a list of 1 to n nums in java list

List<Integer> numbers = Stream.iterate(1, n -> n + 1)
                              .limit(10)
                              .collect(Collectors.toList());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hwo #create #list #nums #java #list
ADD COMMENT
Topic
Name
5+6 =