public class Box <T extends Number> { private T data; } Box<Integer> intBox = new Box<>(2); // Valid type argument Box<Double> doubleBox = new Box<>(2.5); // Valid type argument Box<String> stringBox = new Box<>("hello"); // Error public static <T extends Number> boolean isZero(T data) { return data.equals(0); } //multiple bounds public class Box <T extends Number & Comparable<T>> { private T data; }