/** * * */ package practicebook; import java.util.*; public class arraylist1 { public static void main(String[] args) { // TODO Auto-generated method stub ArrayList <String> myString = new ArrayList<String>(); System.out.println(myString.size()); myString.add("Eve"); myString.add("Anna"); myString.add("Tonny"); myString.add("Steve"); Iterator<String> myStringIterator = myString.iterator(); for(int i=0; i< myString.size() ;++i) { String a = myString.get(i) ; myString.get(i) = "hell" ; } } } //end main} // end class
Iterator<String> myStringIterator = myString.iterator(); while (myStringIterator.hasNext()) { System.out.println(myStringIterator.next()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)