how to convert arraylist to iterable in java

Solutions on MaxInterview for how to convert arraylist to iterable in java by the best coders in the world

showing results for - "how to convert arraylist to iterable in java"
Sara
24 Nov 2017
1Integer[] myArray = {897, 56, 78, 90, 12, 123, 75};
2Iterator<Integer> iterator = Arrays.asList(myArray).iterator();
3
4//Iterator<Integer> iterator = Arrays.stream(myArray).iterator();
5while(iterator.hasNext()) {
6   System.out.println(iterator.next());
7}