Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Why upper bound in Class is not allowed?
Asked
Sep 18 '19 at 10:59
Active
Sep 18 '19 at 11:05
Viewed
91 times
1
Why can't we have the following type of class in JAVA?
public class MyType<T super Integer> { }
java
generics
wildcard
asked Sep 18 '19 at 10:59
krishna
143
1
2
9
2
`Integer` may be a bad example to pick, since it's a `final` class, so it can't be the superclass of anything.
–
T.J. Crowder
Sep 18 '19 at 11:01
2
@T.J.Crowder it has nothing to do with the question!
–
Soner from The Ottoman Empire
Sep 18 '19 at 11:02
1
@snr - Please re-read my comment. The point is: Let's not distract from the question with a bad example.
–
T.J. Crowder
Sep 18 '19 at 11:03
0 Answers
0