Javatpoint Logo
Javatpoint Logo

Java Method getReturnType() Method

The getReturnType() method of Method class returns a Class object that represents the formal return type of the method represented by this Method object.

Syntax

Parameter

No parameter is passed.

Returns

The return type for the method this object represents

Throws

Does not throw an exception.

Example 1

Test it Now

Output:

Return Type:: void

Example 2

Test it Now

Output:

Method Return Type::void
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