Getting and Setting the Value of a Field This example assumes that the field has the type int. try { // Get value field.getInt(object); // Set value field.setInt(object, 123); } catch (IllegalAccessException e) { }