Example :
List list = new ArrayList();
//This would give me the class name for the list reference variable.
list.getClass().getSi
Class aClass = ... //obtain Class object.
Class[] interfaces = aClass.getInterfaces();
Using Reflection you can invoke the Class.getInterfaces() method which returns an Array of Interfaces
that your class implements.
list.getClass().getInterfaces()[0];
To get just the name
list.getClass().getInterfaces()[0].getSimpleName();