1List<String> stockList = new ArrayList<String>();
2stockList.add("stock1");
3stockList.add("stock2");
4
5String[] stockArr = new String[stockList.size()];
6stockArr = stockList.toArray(stockArr);
7
8for(String s : stockArr)
9 System.out.println(s);
10