Vector v = new Vector();
i<10;
v.add(new Integer(i));// what does this lien do?
I dont understand, what does calling (new Integer()
) do? Is is calling the constructor
and passing the value i in it.
Why can't we just pass the value i directly and add it in the vector.