File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can i add any type of collection to Collection<Instrument>

 
Samanthi perera
Ranch Hand
Posts: 510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a collection named
Collection<Instrument> x;

can i add any type of collection x?
any type mean List,Set ,Queue or Map?
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be careful: Map is not a subinterface of Collection

You can build an instance of all the classes implementing subinterfaces of Collection (Set,List,Queue...)
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried? What did you discover in the API documentation?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic