<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.lang.reflect.Constructor
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.lang.reflect.html">This Package</a>  <a href="java.lang.reflect.Array.html#_top_">Previous</a>  <a href="java.lang.reflect.Field.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.lang.reflect.Constructor
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.lang.reflect.Constructor
</pre>
<hr>
<dl>
  <dt> public final class <b>Constructor</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  <dt> implements <a href="java.lang.reflect.Member.html#_top_">Member</a>
</dl>
Constructor provides information about, and access to, a single
 constructor for a class.
 <p>Constructor permits widening conversions to occur when matching the
 actual parameters to newInstance() with the underlying
 constructor's formal parameters, but throws an
 IllegalArgumentException if a narrowing conversion would occur.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.reflect.Member.html#_top_">Member</a>, <a href="java.lang.Class.html#_top_">Class</a>, <a href="java.lang.Class.html#getConstructors()">getConstructors</a>, <a href="java.lang.Class.html#getConstructor()">getConstructor</a>, <a href="java.lang.Class.html#getDeclaredConstructors()">getDeclaredConstructors</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
  <dd>  Compares this Constructor against the specified object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDeclaringClass()"><b>getDeclaringClass</b></a>()
  <dd>  Returns the Class object representing the class that declares
 the constructor represented by this Constructor object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getExceptionTypes()"><b>getExceptionTypes</b></a>()
  <dd>  Returns an array of Class objects that represent the types of
 the checked exceptions thrown by the underlying constructor
 represented by this Constructor object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getModifiers()"><b>getModifiers</b></a>()
  <dd>  Returns the Java language modifiers for the constructor
 represented by this Constructor object, as an integer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getName()"><b>getName</b></a>()
  <dd>  Returns the name of this constructor, as a string.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getParameterTypes()"><b>getParameterTypes</b></a>()
  <dd>  Returns an array of Class objects that represent the formal
 parameter types, in declaration order, of the constructor
 represented by this Constructor object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#hashCode()"><b>hashCode</b></a>()
  <dd>  Returns a hashcode for this Constructor.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#newInstance(java.lang.Object[])"><b>newInstance</b></a>(Object[])
  <dd>  Uses the constructor represented by this Constructor object to
 create and initialize a new instance of the constructor's
 declaring class, with the specified initialization parameters.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Return a string describing this Constructor.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getDeclaringClass()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDeclaringClass"><b>getDeclaringClass</b></a>
<pre>
 public <a href="java.lang.Class.html#_top_">Class</a> getDeclaringClass()
</pre>
<dl>
  <dd> Returns the Class object representing the class that declares
 the constructor represented by this Constructor object.
<p>
</dl>
<a name="getName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getName"><b>getName</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getName()
</pre>
<dl>
  <dd> Returns the name of this constructor, as a string.  This is
 always the same as the name of the constructor's declaring
 class.
<p>
</dl>
<a name="getModifiers()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getModifiers"><b>getModifiers</b></a>
<pre>
 public native int getModifiers()
</pre>
<dl>
  <dd> Returns the Java language modifiers for the constructor
 represented by this Constructor object, as an integer. The
 Modifier class should be used to decode the modifiers.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.lang.reflect.Modifier.html#_top_">Modifier</a>
  </dl></dd>
</dl>
<a name="getParameterTypes()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getParameterTypes"><b>getParameterTypes</b></a>
<pre>
 public <a href="java.lang.Class.html#_top_">Class</a>[] getParameterTypes()
</pre>
<dl>
  <dd> Returns an array of Class objects that represent the formal
 parameter types, in declaration order, of the constructor
 represented by this Constructor object.  Returns an array of
 length 0 if the underlying constructor takes no parameters.
<p>
</dl>
<a name="getExceptionTypes()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getExceptionTypes"><b>getExceptionTypes</b></a>
<pre>
 public <a href="java.lang.Class.html#_top_">Class</a>[] getExceptionTypes()
</pre>
<dl>
  <dd> Returns an array of Class objects that represent the types of
 the checked exceptions thrown by the underlying constructor
 represented by this Constructor object.  Returns an array of
 length 0 if the constructor throws no checked exceptions.
<p>
</dl>
<a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="equals"><b>equals</b></a>
<pre>
 public boolean equals(<a href="java.lang.Object.html#_top_">Object</a> obj)
</pre>
<dl>
  <dd> Compares this Constructor against the specified object.
 Returns true if the objects are the same.  Two Constructors are
 the same if they were declared by the same class and have the
 same formal parameter types.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#equals(java.lang.Object)">equals</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="hashCode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="hashCode"><b>hashCode</b></a>
<pre>
 public int hashCode()
</pre>
<dl>
  <dd> Returns a hashcode for this Constructor. The hashcode is
 the same as the hashcode for the underlying constructor's
 declaring class name.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#hashCode()">hashCode</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Return a string describing this Constructor.  The string is
 formatted as the constructor access modifiers, if any,
 followed by the fully-qualified name of the declaring class,
 followed by a parenthesized, comma-separated list of the
 constructor's formal parameter types.  For example:
 <pre>
    public java.util.Hashtable(int,float)
 </pre>
 <p>The only possible modifiers for constructors are the access
 modifiers <tt>public</tt>, <tt>protected</tt> or
 <tt>private</tt>.  Only one of these may appear, or none if the
 constructor has default (package) access.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="newInstance(java.lang.Object[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="newInstance"><b>newInstance</b></a>
<pre>
 public native <a href="java.lang.Object.html#_top_">Object</a> newInstance(<a href="java.lang.Object.html#_top_">Object</a> initargs[]) throws <a href="java.lang.InstantiationException.html#_top_">InstantiationException</a>, <a href="java.lang.IllegalAccessException.html#_top_">IllegalAccessException</a>, <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>, <a href="java.lang.reflect.InvocationTargetException.html#_top_">InvocationTargetException</a>
</pre>
<dl>
  <dd> Uses the constructor represented by this Constructor object to
 create and initialize a new instance of the constructor's
 declaring class, with the specified initialization parameters.
 Individual parameters are automatically unwrapped to match
 primitive formal parameters, and both primitive and reference
 parameters are subject to widening conversions as necessary.
 Returns the newly created and initialized object.
 <p>Creation proceeds with the following steps, in order:
 <p>If the class that declares the underlying constructor
 represents an abstract class, the creation throws an
 InstantiationException.
 <p>If this Constructor object enforces Java language access
 control and the underlying constructor is inaccessible, the
 creation throws an IllegalAccessException.
 <p>If the number of actual parameters supplied via initargs is
 different from the number of formal parameters required by the
 underlying constructor, the creation throws an
 IllegalArgumentException.
 <p>A new instance of the constructor's declaring class is
 created, and its fields are initialized to their default
 initial values.
 <p>For each actual parameter in the supplied initargs array:
 <p>If the corresponding formal parameter has a primitive type,
 an unwrapping conversion is attempted to convert the object
 value to a value of the primitive type.  If this attempt fails,
 the creation throws an IllegalArgumentException.
 <p>If, after possible unwrapping, the parameter value cannot be
 converted to the corresponding formal parameter type by an
 identity or widening conversion, the creation throws an
 IllegalArgumentException.
 <p>Control transfers to the underlying constructor to
 initialize the new instance.  If the constructor completes
 abruptly by throwing an exception, the exception is placed in
 an InvocationTargetException and thrown in turn to the caller
 of newInstance.
 <p>If the constructor completes normally, returns the newly
 created and initialized instance.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.lang.IllegalAccessException.html#_top_">IllegalAccessException</a>
    <dd> if the underlying constructor
              is inaccessible.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the number of actual and formal
              parameters differ, or if an unwrapping conversion fails.
    <dt> <b>Throws:</b> <a href="java.lang.InstantiationException.html#_top_">InstantiationException</a>
    <dd> if the class that declares the
              underlying constructor represents an abstract class.
    <dt> <b>Throws:</b> <a href="java.lang.reflect.InvocationTargetException.html#_top_">InvocationTargetException</a>
    <dd> if the underlying constructor
              throws an exception.
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.lang.reflect.html">This Package</a>  <a href="java.lang.reflect.Array.html#_top_">Previous</a>  <a href="java.lang.reflect.Field.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
