It is possible specifying more exactly the type used:
public class WithGeneric<T>; public class WithGenericNumber<T extends Number>;
// Valid new WithGeneric<String>(); // Compile error new WithGenericNumber<String>();
public class WithGeneric<T extends A & B & C>;
Last updated 5 years ago
Was this helpful?