Widening type conversion:
package com.logicbig.example.field;
import java.lang.reflect.Field;
public class GetDoubleExample2 {
private int anInt = 3;
public static void main(String... args) throws NoSuchFieldException, IllegalAccessException {
Field field = GetDoubleExample2.class.getDeclaredField("anInt");
double d = field.getDouble(new GetDoubleExample2());
System.out.println(d);
}
}
Output
3.0