📜  如何在java代码示例中循环遍历对象的arraylist

📅  最后修改于: 2022-03-11 14:52:08.239000             🧑  作者: Mango

代码示例2
ArrayList namesList = new ArrayList(Arrays.asList( "alex", "brian", "charles") );
         
for(int i = 0; i < namesList.size(); i++)
{
    System.out.println(namesList.get(i));
}