将集合转换为数组
//package com.nowjava; // 来 自 nowjava - 时 代 Java import java.util.Set; public class Main { public static <T> T[] set2Array(Set<T> oSet) { Object[] oArray = oSet.toArray(new Object[] {}); T[] ts = (T[]) oArray; return ts; } }
//package com.nowjava; // 来 自 nowjava - 时 代 Java import java.util.Set; public class Main { public static <T> T[] set2Array(Set<T> oSet) { Object[] oArray = oSet.toArray(new Object[] {}); T[] ts = (T[]) oArray; return ts; } }