if A is a class.... what is A.class??? and if aa is an object of class A....den what will aa.class return?? A.class is returning "class A" ... but what is dis class?? is it a variable in Object class? what is the relaton between Class & Object class??
Very disturbing question...not exact but some related stuff
We have A.java as a source file having a public class "A" and "aa" as A's object. When you compile A.java, you get A.class. Every class is a subclass of Object. ---- Now if you print A.class in A.java , it comes as "class A" If you try to get "aa.class" , its a compiler error as "aa" isnt a class! ---- We have a class java.lang.Class (extends Object).Instances of the class j.l.Class represent classes and interfaces in a running Java application. j.l.Class objects are constructed automatically by the Java Virtual Machine as classes( like A.class) are loaded and by calls to the defineClass method in the class loader.
---- refer Class Loaders and java.lang.Class to understand more and post here if you get the exact answer.
<i>If there were no Exceptions (not Errors!), Life would have kinda sucked!!</i>