Get Constructor by parameter type
import java.lang.reflect.Constructor;
public class Main {
public static void main(String[] argv) throws Exception {
Constructor con = java.awt.Point.class.getConstructor(new Class[] { int.class, int.class });
System.out.println(con);
}
}
Home
Java Book
Runnable examples
Java Book
Runnable examples
Reflection Constructor:
- Get Constructors and its parameters, modifiers
- Get Constructor by parameter type
- Invoke a Constructor