List<String> list = new ArrayList<String>();
String[] array = new String[10];
Set<String> set = new HashSet<String>();
1.数组转成List
list = java.util.Arrays.asList(array);
注:这个java.util.Arrays.asList返回的是该类内部实现的ArrayList,没有addAll方法,如果要用addAll,可以使用如下表达式:
list = new ArrayList(java.util.Arrays.asList(array));
2.List转成数组
array = org.springframework.util.StringUtils.toStringArray(list);
或:
String[] array = new String[list.size()];
array = list.toArray(array);
3.Set转成List
list = new ArrayList(set);
4.List转成Set
new HashSet<String>(list);
5.Set转成数组
array = authedUrlSet.toArray(array);