• 2021-04-14
    阅读下列程序publicclassExample{publicstaticvoidmain(String[]args){ArrayListlist=newArrayList();//创建ArrayList集合list.add("Tom");//向该集合中添加字符串list.add("Jerry");list.add("Donald");ListIteratorit=list.listIterator();while(it.hasNext()){Objectobject=it.next();if("Jerry".equals(object)){it.set("Speike");}}System.out.println(list);}}程序的运行结果是()
  • 举一反三