String[] arr= new String[]{"A", "B", "C"};
List list = Arrays.asList(arr);
Object[] result = list.toArray(); //使用toArray()方法
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
byte[] bytes=Bytes.toArray(list);
String[] arr= new String[]{"A", "B", "C"};
List list = Arrays.asList(arr);
Set result = new HashSet(list); //list转set
5、Set转数组
String[] arr= new String[]{"A", "B", "C"};
Set<String> set= new HashSet<>(Arrays.asList(arr));
Object[] result = set.toArray(); //使用toArray()方法
6、Set转List
String[] arr= new String[]{"A", "B", "C"};
Set<String> set= new HashSet(Arrays.asList(arr));
List<String> result = new ArrayList<>(set);