dimanche 21 juillet 2019

Can we get the actual argument name of a method at runtime using reflection?

I have the below method in one of my classes. public String sampleMethod(final String sampleString){}

I have a method object "m" of the above method and doing a m.getParameters()[0].getName(); and it gives me String "arg0" Is there a way to get the actual argument name "sampleString" instead of "arg0" using "Reflection"?

Thanks in advance, Madhu





Aucun commentaire:

Enregistrer un commentaire