Java Method getGenericReturnType() MethodThe getGenericReturnType() method of Method class returns a Type object that represents the formal return type of the method represented by this Method object. If the return type is a parameterized type, the Type object returned must accurately reflect the actual type parameters used in the source code. SyntaxParameterNo parameter is passed. Returnsa Type object that represents the formal return type of the underlying method ThrowsGenericSignatureFormatError TypeNotPresentException MalformedParameterizedTypeException Example 1Test it NowOutput: class java.lang.String Example 2Test it NowOutput: void
Next TopicJava Method Class
|