Class Constructor


  • public final class Constructor
    extends java.lang.Object
    Provides information about, and access to, a single constructor for a Class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class getDeclaringClass()
      Returns the Class object representing the class or interface that declares the constructor.
      java.lang.Class[] getParameterTypes()
      Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor.
      boolean isAccessible()  
      java.lang.Object newInstance​(java.lang.Object... args)
      Uses the constructor to create and initialize a new instance of the constructor's declaring class, with the supplied initialization parameters.
      void setAccessible​(boolean accessible)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getParameterTypes

        public java.lang.Class[] getParameterTypes()
        Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor.
      • getDeclaringClass

        public java.lang.Class getDeclaringClass()
        Returns the Class object representing the class or interface that declares the constructor.
      • isAccessible

        public boolean isAccessible()
      • setAccessible

        public void setAccessible​(boolean accessible)
      • newInstance

        public java.lang.Object newInstance​(java.lang.Object... args)
                                     throws ReflectionException
        Uses the constructor to create and initialize a new instance of the constructor's declaring class, with the supplied initialization parameters.
        Throws:
        ReflectionException