Here you can find the source of getMethodReturnType(Class> clazz, String methodName)
public static Class<?> getMethodReturnType(Class<?> clazz, String methodName)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { /**//from www . j a v a2 s . c om * Returns return type of given method in given class. */ public static Class<?> getMethodReturnType(Class<?> clazz, String methodName) { try { Method method = clazz.getDeclaredMethod(methodName); return method.getReturnType(); } catch (NoSuchMethodException e) { throw new AssertionError(e); } catch (SecurityException e) { throw new AssertionError(e); } } }