• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generics doubt from nikos

 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No they are not the same. See the difference with extends and super.
With q1 there is an guaranty that all the elements are a Number or a subclass of it.
So you can retrieve elements like this:

With q2 there is an that the queue can hold elements of type Integer and subclasses of it.
 
Neha Daga
Ranch Hand
Posts: 504
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no matter what is on the right side when you assign both left sides should be compatible.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic