How to check instanceof on an argument that is a Class object?
问题 I'm trying to build a generic class loader. I need to check classes that I load against a method argument to determine if they are of the same class. The code mostly explains what I'm trying to do. private static LinkedList<Object> loadObjectsInDirectory(Class class0, File dir) throws ClassNotFoundException { LinkedList<Feature> objects = new LinkedList<Object>(); ClassLoader cl = new GenericClassLoader(); for(String s : dir.list()) { Class class1 = cl.loadClass(s); try { Object x = class1