Chandra shekar M wrote: What does this mean? a Class representing an Interface
java.lang.Class is just a class, just like
ArrayList,
String,
JButton etc. Instances of
java.lang.Class correspond to actual classes or interfaces.
So
String.class is an instance of
java.lang.Class representing
String.
List.class is an instance of
java.lang.Class representing
List. And so on.
Methods like
getInterfaces() belong to the
java.lang.Class class - it's this class that's at the heart of the reflection API. So
ArrayList.class.getInterfaces() returns
java.lang.Class objects representing the interfaces that
ArrayList implements.
(I've fully qualified
java.lang.Class in the above description to try and make it clear when I'm referring to that, and when I'm referring to the
word "class" more generally)