9

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

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

Sagar Pudi
  • 4,634
  • 3
  • 32
  • 51

1 Answers1

10

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

Robby Cornelissen
  • 91,784
  • 22
  • 134
  • 156