The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.lang.reflect  [17 examples] > Constructors  [2 examples]

e117. Creating an Object Using a Constructor Object

This example creates a new Point object from the constructor Point(int,int).
    try {
        java.awt.Point obj = (java.awt.Point)con.newInstance(
            new Object[]{new Integer(123), new Integer(123)});
    } catch (InstantiationException e) {
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }

 Related Examples
e116. Getting a Constructor of a Class Object

See also: Arrays    Fields    Methods    Modifiers   


© 2002 Addison-Wesley.