Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to convert arraylist to iterable in java

Integer[] myArray = {897, 56, 78, 90, 12, 123, 75};
Iterator<Integer> iterator = Arrays.asList(myArray).iterator();

//Iterator<Integer> iterator = Arrays.stream(myArray).iterator();
while(iterator.hasNext()) {
   System.out.println(iterator.next());
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #convert #arraylist #iterable #java
ADD COMMENT
Topic
Name
4+4 =