public class list demo { public static void main(String[]args){ ArrayList & lt;字符串& gtarrayList = new ArrayList & lt字符串& gt();ArrayList . add(" ABC ");ArrayList . add(" def ");ArrayList . add(" GHI ");//for循環遍歷for(int I = 0;我& ltArrayList . size();i++)system . out . println(ArrayList . get(I));system . out . println("-");//針對(strings:ArrayList)system . out . println(s)的循環遍歷進行了增強;system . out . println("-");//叠代器遍歷(叠代器