Search code examples
javadecompiling.class-filefully-qualified-naming

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


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.


Solution

  • getClass().getName()
    

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