1ArrayList<String> namesList = new ArrayList<String>(Arrays.asList( "alex", "brian", "charles") );
2
3for(String name : namesList)
4{
5 System.out.println(name);
6}
7
1ArrayList<String> namesList = new ArrayList<String>(Arrays.asList( "alex", "brian", "charles") );
2
3for(int i = 0; i < namesList.size(); i++)
4{
5 System.out.println(namesList.get(i));
6}
7