Collections

Hashcode and Equals

The java.lang.Object has two methods defined in it. They are

  • public boolean equals(Object obj)
  • public int hashCode().

(more…)

Advertisements

Collection Questions

Tutorials
http://docs.oracle.com/javase/tutorial/collections/TOC.html

Q: ArrayList v/s Vector

A: Vector and ArrayList both uses Array internally as data structure. They are dynamically resizable. Difference is in the way they are internally resized. By default, Vector doubles the size of its array when its size is increased. But, ArrayList increases by half of its size when its size is increased. (more…)