📜  Android java toArray转String数组-Java代码示例

📅  最后修改于: 2022-03-11 14:52:21.933000             🧑  作者: Mango

代码示例1
List stockList = new ArrayList();
stockList.add("stock1");
stockList.add("stock2");

String[] stockArr = new String[stockList.size()];
stockArr = stockList.toArray(stockArr);

for(String s : stockArr)
    System.out.println(s);