class ArrayListTest
{
public static void main(String[] args)
{
// ArrayList<String> list = new ArrayList<String>();
List<String> list = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
String s = new String();
System.out.println("input strings(to quit,please input quit):");
System.out.print('#');
while(!((s = sc.next()).equals("quit"))){
list.add(s);
System.out.print('#');
}
/* for(int i=0; i<list.size(); i++)
System.out.println(list.get(i));*/
/* for(String ss : list)
System.out.println(ss);*/
Iterator it = list.iterator();
while(it.hasNext())
System.out.println(it.next());
}
}