Code example for Field

Methods: isAccessiblesetAccessiblesetInt

        int foo;
    private static void setIntField(Object o, String fieldName, int value) throws Exception {
        final Field field = o.getClass().getDeclaredField(fieldName);
        final boolean accessible = field.isAccessible();
        field.setInt(o, value);
    public static void main(String[] args) throws Exception {
        final TestIntField t = new TestIntField();
        setIntField(t, "foo", 1324);
        System.out.println(" = " +;
        final Eagle eagle = new Eagle(1);
        try { 
Connect your IDE to all the code out there  Get Codota for Java