You should be using Class.forName( "fully_qualified_name" ) to generate a Class object, or using the .getClass() method on an already instantiated object. Also, for int types, the class is defined in the Integer.TYPE property.
I need a little more clarification of what you are attempting to do, match the same type? You can use a number of methods, what is the end goal?
Ok, now that you've clarified... heres some help ... just pass in a class..
public boolean doesClassImplementList(Class genericClass)
{
// help me fill this in
// this method should return true if genericClass implements List
// I can't do this because it doesn't compile:
//this will give you a a list of class this class implements
Class[] classesImplementing = genericClass.getInterfaces();
//loop through this array and test for:
for(int i=0; i<classesImplementing.length; i++) {
if (classesImplementing[i].getName().equals("java.util.List")) {
return true;
}
}
return false;
}