How to read the fully qualified name of a .class file

TacB0sS picture TacB0sS · Jul 21, 2010 · Viewed 11.5k times · Source

Hey, I think the title sums it, but still.

I need to extract the fully qualified name of an object from its compiled .class file, could anyone point me in the right direction?

Thanks,
Adam.

Answer

Bozho picture Bozho · Jul 21, 2010
getClass().getName()

Update: You can load the class-file into a byte[] (using standard i/o) and then use getClass().getClassLoader().defineClass(...)