Java tutorial
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Field; public class Main { private static Object getField(Object paramObject, Class<?> paramClass, String paramString) throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException { Field localField = paramClass.getDeclaredField(paramString); localField.setAccessible(true); return localField.get(paramObject); } }