• Post Reply Bookmark Topic Watch Topic
  • New Topic

capacity method  RSS feed

 
Tapan Maru
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vector class in java has capacity method. My question is why it is not in any generic class like AbstractCollection so that any collection class can call that method to check current capacity?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not all collection implementations have a capacity. A LinkedList, for example, hasn't.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!