Created
July 30, 2015 10:42
-
-
Save joa/b33da09d811e8f269fe9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Constructor; | |
import java.util.Arrays; | |
import java.util.List; | |
public final class Foo { | |
public static void main(String[] args) { | |
final Constructor<?>[] ctors = A.class.getDeclaredConstructors(); | |
for(Constructor<?> ctor : ctors) { | |
System.out.println(Arrays.toString(ctor.getParameterTypes())); | |
System.out.println(Arrays.toString(ctor.getGenericParameterTypes())); | |
System.out.println(); | |
} | |
} | |
private class A { | |
A(String a) {} | |
A(List<String> a) {} | |
} | |
} |
Author
joa
commented
Jul 30, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment