ArrayListTest1

ArrayListTest1 - aList.add("Dan");

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.ArrayList; import java.util.Iterator; i public class ArrayListTest1 { public static void main (String [] arg) { System.out.println("\nArrayListTest \n"); ArrayList<String> aList = new ArrayList<String>();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: aList.add(&quot;Dan&quot;); aList.add(&quot;George&quot;); aList.add(&quot;Mary&quot;); System.out.println(&quot;aList contains:&quot;); for(int x = 0; x &lt; aList.size(); x++) { System.out.println(aList.get(x)); } } }...
View Full Document

Ask a homework question - tutors are online