In the wikipedia page on the factory pattern
What does Constructor<?> mean in the statement
HashMap<String,Constructor<?>> factoryServices ?
Printable View
In the wikipedia page on the factory pattern
What does Constructor<?> mean in the statement
HashMap<String,Constructor<?>> factoryServices ?
Constructor is a class in the java.lang.reflect package. Instances of this class represent a single constructor in another class and provide information about that constructor. They also allow access to the constructor so by using the newInstance(...) method you can create an object of the type the Constructor represents.
Many thanks for your reply. I was wondering about the <?> , what does that mean ?
It's a generics wildcard character meaning the constructor can be a constructor for an object of any type.