Javatpoint Logo
Javatpoint Logo

Java Method getParameterCount() Method

The 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.

Syntax

Parameter

No parameter is passed.

Returns

The number of formal parameters for the executable this object represents

Throws

Does not throw an exception.

Example 1

Test it Now

Output:

3

Example 2

Test it Now

Output:

No of parameters in method1 :  4
Next TopicJava Method Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA