Difference Between ArrayList and Vector in Java
ArrayList is a resizable array: fast get by index, slower insert in the middle. LinkedList is nodes with next/prev: faster insert/delete at ends, slower random index get.
Day to day, almost every fresher program uses ArrayList. Use LinkedList only when you truly insert/delete a lot at the ends.
Vector is like an old synchronized ArrayList. Prefer ArrayList + explicit sync if you need thread safety.
Let's take this on the board with one tiny Main class — no extra files. Difference Between ArrayList and Vector in Java — output: 2 then Asha. add Asha, add Ravi. size is 2. get(0) is Asha. get(2) would throw IndexOutOfBoundsException. Start from main, go line by line, and stop at each print. That output is the proof for Difference Between ArrayList and Vector.
ArrayList names
add("Asha") add("Ravi")
│
▼
[0]=Asha [1]=Ravi size=2Say: ArrayList = dynamic array with index access.