iterateAarrayList.java
/**
* Write a program to traverse (or iterate) ArrayList?
*/
import java.util.*;
public class iterateAarrayList {
public static void main(String[] args) {
List NumberList = Arrays.asList(25,13,15,25,88,15);
for(int i=0;i {
System.out.print(NumberList.get(i) + " ");
}
}
}
Output:
LENOVO@DESKTOP-U7S0D\assignment no2_8be11fb
25 13 15 25 88 15