//List转数组 List<String> validators = new ArrayList<>(); validators.add("yuntrust"); validators.add("zhongbang"); String[] validatorsArr = new String[validators.size()]; validatorsArr = validatorsArr.toArray(validatorsArr); //数组转List String[] strArr = new String[]{"data","data2"}; List<String> validators = Arrays.asList(strArr); //使用 validators.toArr Class ArrayList{ public <T> T[] toArray(T[] a) { if (a.length < size) // Make a new array of a's runtime type, but my contents: return (T[]) Arrays.copyOf(elementData, size, a.getClass()); System.arraycopy(elementData, 0, a, 0, size); if (a.length > size) a[size] = null; return a; } }