華氏摂氏変換プログラム(PULL)

    public class Main {
        public static void main(String[] args) {
            TempF tempF = new TempF();
            TempC tempC = new TempC(tempF);
            tempF.setValue(68);
            System.out.println(tempC.getValue());
        }
    }

    public class TempF {
        double value;

        public TempF() {
        }

        public void setValue(double tempF) {
            this.value = tempF;
        }

        public double getValue() {
            return value;
        }
    }

    public class TempC {
        TempF tempF;

        public TempC(TempF tempF) {
            this.tempF = tempF;
        }

        public double getValue() {
            return (tempF.getValue() - 32) / 1.8;
        }
    }