Answers for "how to convert arraylist to iterable in java"

0

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());
}
Posted by: Guest on February-17-2021

Code answers related to "how to convert arraylist to iterable in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language