Java tutorial
//package com.java2s; import java.lang.reflect.Field; import java.lang.reflect.Type; public class Main { public static Type getFieldType(Class<?> clazz, String fieldName) { try { Field field = clazz.getField(fieldName); return field.getGenericType(); } catch (Exception ex) { return null; } } }