Java tutorial
import java.lang.reflect.Field; class MyClass { public float i = 1.123F; } public class Main { public static void main(String[] args) throws Exception { Class<?> clazz = Class.forName("MyClass"); MyClass x = (MyClass) clazz.newInstance(); Field f = clazz.getField("i"); System.out.println(f.getFloat(x)); f.setFloat(x, 9.99F); System.out.println(f.getFloat(x)); } }