java中的和有什么区别? [重复]

时间:2022-02-24 13:20:35

This question already has an answer here:

这个问题在这里已有答案:

In Java generics, What is the advantage of using class GenericStack<T extends Object> {} over class GenericStack<T>{}.

在Java泛型中,使用类GenericStack {}优于类GenericStack {}的优点是什么。

I have implemented a generic stack using both of the above approaches but unable to trace out the difference. Help me to understand this.

我已经使用上述两种方法实现了泛型堆栈,但无法找出差异。帮我理解这个。

1 个解决方案

#1


6  

There's no difference. <T> and <T extends Object> are equivalent.

没有区别。 是等价的。

#1


6  

There's no difference. <T> and <T extends Object> are equivalent.

没有区别。 是等价的。