Get a particular Constructor object in Java

Description

The following code shows how to get a particular Constructor object.

Example


//from   www.ja va  2 s .c om
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);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Reflection »




Annotation
Array
Class
Constructor
Field
Generics
Interface
Method
Modifier
Package
Proxy