This is the new method added in jdk1.8
https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Executable.html#getParameters--
https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Executable.html#getParameters--
import java.lang.reflect.Method; import java.util.Arrays; public class GetParamtersEx { public static void main(String[] args) { Method[] me = SampleEx.class.getDeclaredMethods(); Arrays.stream(me).forEach(x -> Arrays.stream(x.getParameters()) .forEach(y -> System.out.println(y.getName()))); } }
No comments:
Post a Comment