|
Articles > Misc > How to get method parameter names using Java reflection |
|
How to get method parameter names using Java reflection
Author: Venkata Sudhakar
The below example shows how to get method parameter name using Java reflection. In Java 8 and above you can include debugging information about method parameters by compiling with -parameters compiler flag.
Output without -parameters compiler flag,
arg0
arg1
Output with -parameters compiler flag,
javac -parameters ParamNamesExample.java
first
second
Maven users can try the following compiler plugin configuration
|
|