package com.sf._01_泛型.demo1;

public class Test {
    public static void main(String[] args) {
        Calculator<Integer> calculator = new Calculator<>(10);
        Calculator<Double> calculator1 = new Calculator<>(3.4);

        System.out.println(calculator.add(20));  // 传入int
        System.out.println(calculator1.add(1.3)); // double

        System.out.println(calculator.multiply(10));
        System.out.println(calculator.multiply(3.4));

    }
}
