Java Class getConstructor() MethodThe getConstructor() method of java Class class returns a Constructor object that reflects the public constructor of the class. SyntaxParameterparameterTypes - the parameter array. ReturnsConstructor object. ThrowsNoSuchMethodException , SecurityException Example 1Test it NowOutput: public java.lang.String(java.lang.String) //class path Example 2Test it NowOutput: Default Constructor... Parameterized Constructor....(one parameter) public ClassgetConstructorExample2$Class1() public ClassgetConstructorExample2$Class1(int) public ClassgetConstructorExample2$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