How can i get varibles used in Method which then I will write their values on Console ?
See Question&Answers more detail:osHow can i get varibles used in Method which then I will write their values on Console ?
See Question&Answers more detail:osYou cannot. Reflection does not extend to reading the values of method variables. It only handles the declaration metadata of variables. And even then, the compiler may have removed the variable you thought you declared. Reflection allows full access to fields (instance / static type variables), but not method variables.
There are tricks you can use like lambda expressions, but this changes their form (from method variables into instance fields).