loop through arraylist kotlin code example
Example 1: java loop through arraylist
ArrayList<String> namesList = new ArrayList<String>(Arrays.asList( "alex", "brian", "charles") );
for(String name : namesList)
{
System.out.println(name);
}
Example 2: kotlin iterate array
val names = listOf("Anne", "Peter", "Jeff")
for (name in names) {
println(name)
}