Results 1 to 4 of 4
Thread: Methods of the java.util.Vector
- 12-25-2008, 02:18 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 30
- Rep Power
- 0
- 12-25-2008, 02:38 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Why you think that once the class is synchronized, methods must synchronized.
- 12-25-2008, 06:02 PM #3
Member
- Join Date
- Dec 2008
- Posts
- 30
- Rep Power
- 0
Then what do we mean when we say the Vector class is synchronized ?
- 12-26-2008, 03:01 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I hope you know what's meaning on synchronized, right?
Vector class basically implements an array of objects. But the size can grow or shrink accordingly.
More details from the Java doc.
If you have read carefully, you can find the solution form there.Each vector tries to optimize storage management by maintaining a capacity and a capacityIncrement. The capacity is always at least as large as the vector size; it is usually larger because as components are added to the vector, the vector's storage increases in chunks the size of capacityIncrement. An application can increase the capacity of a vector before inserting a large number of components; this reduces the amount of incremental reallocation.
Similar Threads
-
java.util.zip Question
By acp26b in forum New To JavaReplies: 3Last Post: 08-07-2008, 05:12 AM -
java.util
By Java Tutorial in forum Java TutorialReplies: 1Last Post: 02-07-2008, 01:46 PM -
Using java.util.Formatter
By Java Tip in forum Java TipReplies: 0Last Post: 11-16-2007, 02:29 PM -
how to use java.util.Properties?
By christina in forum New To JavaReplies: 2Last Post: 08-03-2007, 05:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks