Java tutorial
//package com.java2s; import java.lang.reflect.Field; public class Main { public static void reflect(Object o) throws Exception { Class cls = o.getClass(); Field[] fields = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; f.setAccessible(true); } } }