Java Method getParameterCount() MethodThe getParameterCount() method of Method class Returns the number of formal parameters (whether explicitly declared or implicitly declared or neither) for the executable represented by this object. SyntaxParameterNo parameter is passed. ReturnsThe number of formal parameters for the executable this object represents ThrowsDoes not throw an exception. Example 1Test it NowOutput: 3 Example 2Test it NowOutput: No of parameters in method1 : 4
Next TopicJava Method Class
|