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,396
  • 3
  • 31
  • 51

1 Answers1

8

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

Robby Cornelissen
  • 81,630
  • 19
  • 117
  • 142