Created
October 28, 2018 18:40
-
-
Save mcihad/37404a7e31dc93ea3ce8233a7ae2c4c9 to your computer and use it in GitHub Desktop.
Generic Parameter Type
This file contains hidden or 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
Type type = this.getClass().getGenericSuperclass(); | |
ParameterizedType pt = (ParameterizedType) type; | |
Class c = (Class)pt.getActualTypeArguments()[0]; | |
System.out.println(c.getSimpleName()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment