Monday, 16 December 2013

ArrayList in java

List<String> someList = new ArrayList<String>()
 // add "monkey", "donkey", "skeleton key" to someList

 someList.add(monkey1);
 someList.add(donkey2);
 someList.add(skeleton key3);
 someList.add(tesrt4);
 for(String item : someList )
 {

 System.out.println(item);

 }

No comments:

Post a Comment