![]() |
The Java Developers Almanac 1.4 |
|
e117. Creating an Object Using a Constructor ObjectThis example creates a newPoint 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) {
}
© 2002 Addison-Wesley. |