import java.util.Arrays;
import java.util.Iterator;
public class ArrayToIterable {
public static void main(String args[]){
Integer[] myArray = {897, 56, 78, 90, 12, 123, 75};
Iterator<Integer> iterator = Arrays.stream(myArray).iterator();
while(iterator.hasNext()) {
System.out.println(iterator.next());
}
}
}
class Main {
public static void main(String args[]){
int arr[]={1,2,3,4,5};
//i starts with 0 as array index starts with 0 too
for(int i=0; i<arr.length; i++){
System.out.println(arr[i]);
}
}
}