aspose file tools*
The moose likes Java in General and the fly likes capacity method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "capacity method" Watch "capacity method" New topic

capacity method

Tapan Maru
Ranch Hand

Joined: May 08, 2006
Posts: 65
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?

Tapan Maru
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3433

Not all collection implementations have a capacity. A LinkedList, for example, hasn't.
I agree. Here's the link:
subject: capacity method
Similar Threads
capacity of a stringbuffer
the capacity() method
BigDecimal nextProbablePrime(). HashMap initial capacity
ArrayList vs Vector Size and Capacity difference ?
Local Inner Class: Quick Question.