Java tutorial
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Field; public class Main { public static Object getStaticFieldValue(Class<?> clazz, String fieldName) throws Exception { Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); return field.get(fieldName); } }