Here you can find the source of toClasses(Object[] args)
Parameter | Description |
---|---|
args | An arbitrary list of objects |
@SuppressWarnings("rawtypes") public static final Class[] toClasses(Object[] args)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w. j ava 2 s. co m*/ * From a list of objects, extracts a list of corresponding classes. * @param args An arbitrary list of objects * @return A list that for each input object contains the corresponding class. */ @SuppressWarnings("rawtypes") public static final Class[] toClasses(Object[] args) { if (args.length <= 0) return new Class[0]; Class[] value = new Class[args.length]; int iter = 0; for (Object A : args) { value[iter] = A.getClass(); iter++; } return value; } }