What is the parameterized type of this Constructor in Java reflection?
java.lang.reflect.Constructor[] constructors = Stock.class.getDeclaredConstructors();
I've tried Constructor<Stock>[]
, Constructor<Stock.class>[]
, and Constructor<Class>[]
.
The return type of getDeclaredConstructors()
is <?>
which is just any type.
Constructor<?>[] constructors = Stock.class.getDeclaredConstructors();
More info:
What does the question mark in Java generics' type parameter mean?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.