Java Method getAnnotatedReturnType() MethodThe 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. SyntaxParameterNo parameter is passed. Returnsan object representing the return type of the method or constructor ThrowsNo exception is thrown. Example 1Test it NowOutput: Type: java.io.File Annotations: [] Example 2Test it NowOutput: Annotations: [@ReflectMethodgetAnnotatedReturnTypeExample2$customAnnotatedType()] Type = ConstructorgetAnotatedReceiverTypeExample2$Work
Next TopicJava Method Class
|