// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class DoubleWrapper {
    private double val;
    private boolean ini;
    public DoubleWrapper() {
        ini = false;
    }
    public void setVal(double val) {
        this.val = val;
        ini = true;
    }
    @Override
    public String toString() {
        return ini ? Double.toString(val) : "X";
    }
    public static void main(String[] args) {
        DoubleWrapper dw = new DoubleWrapper();
        System.out.println(dw);
        dw.setVal(123.456);
        System.out.println(dw);
    }
}
