StupidBeauty
Read times:976Posted at:Mon Mar 18 22:24:57 2013
- no title specified

转载 convert String arraylist to string array in java?

将ArrayList<String>类型的变量list转换成String[],可以使用String[] array=list.toArray(new String[list.size()])。

http://stackoverflow.com/questions/4042434/convert-string-arraylist-to-string-array-in-java

亮点:

List<String> list = ..;

String[] array = list.toArray(new String[list.size()]);

The toArray() method without passing any argument returns Object[]. So you have to pass an array as an argument, which will be filled with the data from the list, and returned. You can pass an empty array as well, but you can also pass an array with the desired size.

未知美女

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4