vendredi 5 mai 2017

Any difference between using method.invoke and just run the method for a public method in java?

I'm viewing somebody's code, and find that he once changed a method from running directly to use method.invoke, which is a public method (to be precise, it's sun.jvm.hotspot.tools.jcore.ClassDump.main in sa-jdi.jar).

And If I modify it back to running directly, it seems working all fine.

So anyone can tell be what's the difference between running directly and using method.invoke? I'm really curious about why he changed the code.





Aucun commentaire:

Enregistrer un commentaire