Initialization of an Arraylist in one line example.
0
5
Arraylist and Vector class both implement the List interface.
0
6
Polymorphism: Why use“List list = new Arraylist” instead of“Arraylist list =
new Arraylist”?
0
7
The first declaration ensures that you only call methods on
myList that are defined by the List interface(so no Arraylist specific methods).
0
8
There are two basic differences that distinguish Arraylist and Vector is that Vector belongs to Legacy classes that were later reengineered to support the collection classes whereas, an Arraylist is a standard collection class.