Javatpoint Logo
Javatpoint Logo

Java Method getAnnotatedReturnType() Method

The getAnnotatedReturnType() method of Method class returns an AnnotatedType object that represents the use of a type to specify the return type of the method/constructor represented by this Executable object.

Syntax

Parameter

No parameter is passed.

Returns

an object representing the return type of the method or constructor

Throws

No exception is thrown.

Example 1

Test it Now

Output:

Type: java.io.File
Annotations: []

Example 2

Test it Now

Output:

Annotations: [@ReflectMethodgetAnnotatedReturnTypeExample2$customAnnotatedType()]
Type = ConstructorgetAnotatedReceiverTypeExample2$Work
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