Answers for "how to iterate array list in java"

18

java loop through arraylist

ArrayList<String> namesList = new ArrayList<String>(Arrays.asList( "alex", "brian", "charles") );
         
for(String name : namesList)
{
    System.out.println(name);
}
Posted by: Guest on March-29-2020
0

iterate list in java

Iterator itr=list.iterator();
while(itr.hasNext)
{
 system.out.println(itr.next); 
}
Posted by: Guest on September-04-2020

Code answers related to "how to iterate array list in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language