Super and extends in java generic

Question about java generic:
Why is “extends T” allowed but not “implements T”?


There is no semantic difference in the generic constraint language between whether a class ‘implements’ or ‘extends’. The constraint possibilities are ‘extends’ and ‘super’ – that is, is this class to operate with assignable to that other one (extends), or is this class assignable from that one (super).


Additional Example of super and extends in java generic:


About yingding wang
i am looking forward to innovation in IT and Robotics

Comments are closed.

%d bloggers like this: