Question
What is difference between an ArrayList and a vector

Answers

• Synchronization - ArrayList is not thread-safe whereas Vector is thread-safe. In Vector class each method like add(), get(int i) is surrounded with a synchronized block, thus making Vector class thread-safe.

• Data growth - Internally, both the ArrayList and Vector hold onto their contents using an Array. When an element is inserted into an ArrayList or a Vector, the object will need to expand its internal array if it runs out of room. A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent.

• Performance - Since vector is thread-safe, the performance is slower than ArrayList.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Why is Japan called 'the land of rising sun' ?
  • Q Htin Kyaw is the President of which country?
  • Q Which country are the current Olympic Rugby Champions 1924
  • Q What is the mean of Cheap Money?
  • Q What position do you often sleep in?
  • Q The 36th International Geological Congress (IGC) will be held in which city in the year 2020?
  • Q What are the functions of price mechanism in a free market economy?
  • Q No. of different characters in ASCII coding system?
  • Q Who was the last British monarch of the House of Hanover?
  • Q If we have to create multiple positions, what method or tool we can use to avoid errors due to creating them manually.
  • Q What is the default cache service of hibernate?