Java Class getConstructors() MethodThe getConstructors() method of java Class class returns an array which contains the constructor object reflected by the public constructors of this class. If no constructor is defined, it returns an array of length 0. SyntaxParameterNA ReturnsAn array of all the constructor. ThrowsSecurityException Example 1Test it NowOutput: Frame Constructors:: Constructor 1:: public java.awt.Frame(java.lang.String,java.awt.GraphicsConfiguration) Constructor 2:: public java.awt.Frame(java.lang.String) throws java.awt.HeadlessException Constructor 3:: public java.awt.Frame(java.awt.GraphicsConfiguration) Constructor 4:: public java.awt.Frame() throws java.awt.HeadlessException Example 2Test it NowOutput: public ClassgetConstructorsExample2$Class1() public ClassgetConstructorsExample2$Class1(int) public ClassgetConstructorsExample2$Class1(java.lang.String,java.math.BigInteger[]) Next TopicJava Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India