/**
* <p>功能描述:List2Array</p>
*
* @param args
* @author 胡晓 <BR> kskr@qq.com <BR>
* 时间:2010-3-18 上午10:07:02 <BR>
*/
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("aaa");
list.add("bbb");
list.add("ccc");
String[] strArray = (String[])list.toArray(new String[list.size()]);
for (String string : strArray) {
System.out.println(string);
}
}
/**
* <p>功能描述:Array2List</p>
*
* @param args
* @author 胡晓 <BR> kskr@qq.com <BR>
* 时间:2010-3-18 上午10:06:46 <BR>
*/
public static void main(String[] args) {
String[] strArray = new String[]{"aaa","bbb","ccc"};
List<String> list = Arrays.asList(strArray);
for (String str : list) {
System.out.println(str);
}
}
分享到:
相关推荐
C# Array和ArrayList,List区别
javascript array list into setjavascript array list into setjavascript array list into setjavascript array list into setjavascript array list into setjavascript array list into setjavascript array ...
#ifndef __LIST_H__ #define __LIST_H__ struct list; struct list *list_init(); void list_free(struct list *list); int list_isempty(struct list *list); void list_clear(struct list *list); int list_...
主要介绍了Python中list以及list与array的相互转换实现方法,简单分析了Python中list的功能、使用方法及list与array相互转换实现技巧,需要的朋友可以参考下
Lecture_2_Array_and_liked_list.pdf
数据结构英文教学课件:chapter4 Array and Linked list exercise.ppt
java List、Set与Array之间的相互转换 java List、Set与Array之间的相互转换
第 05 节_GEE 的数据类型(Dictionary,List,Array).pdf
Hibernate常见集合映射(Set,List_Array,Map,Bag)
Json格式的字符串转成List、Array、Map、Object、List等,就是各种字符串转其他格式的方法.有个封装好的转换方法和一个我自己做的示例
List的contains方法、Array的contains方法的使用
Python列表list数组array常用操作集锦.docx
matlab数组字符串
数据结构英文课件:Chap5 Array, Matrix and Generalized List.ppt
九章算法之链表与数组(Linked List & Array) 多看多思考
以上这篇对numpy的array和python中自带的list之间相互转化详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持软件开发网。 您可能感兴趣的文章:pytorch: tensor类型的构建与相互转换...
VC数组列表中删除开发设计代码VC development and design of the array to remove the code list
主要介绍了java中List、Array、Map、Set等集合相互转换的相关资料,需要的朋友可以参考下