java数据结构和算法(ListToArrayUtil)

来源:互联网 发布:java字符串替换某一位 编辑:程序博客网 时间:2024/06/05 07:52
package cn.xyc.sortUtil;import java.util.List;/** *  * 描述:将集合转换成数组 *  * <pre> * HISTORY * **************************************************************************** *  ID   DATE           PERSON          REASON *  1    2016年10月3日        80002253         Create * **************************************************************************** * </pre> *  * @author 蒙奇·D·许 * @since 1.0 */@SuppressWarnings("rawtypes")public class ListToArrayUtil {public static Comparable[] toArray(List c) {Comparable[] com = new Comparable[c.size()];for (int j = 0; j < c.size(); j++) {com[j] = (Comparable) c.get(j);}return com;}}

0 0
原创粉丝点击