Fetching Class Name from a static method
807603Aug 9 2005 — edited Jan 31 2008Hi,
I want to find the name of the Class, without instantiating the class.
Consider Class XYZ, which has a static method as method1()
public static String method1(){
// this method should return the name of the class as 'XYZ'
}
In class PQR, i would be calling the mthod1 as
String classname = XYZ.method1();
Is this possible, if yes, how do I do this.
Please reply.
Many Tx.
Mukta