6
Answers

Restrict type with Generics Constraints

Photo of Cuong Pham

Cuong Pham

11y
1.5k
1
Hi everyone,

I want to build a example about Generics Constraint with the question:

How will the complier catch a error when user input string type but reasonable with int, float, double, long type?
Can you help me this problem?

Many thanks.

Answers (6)