Why this didn't work
import java.util.ArrayList;
public class Vector
{
ArrayList<Long> vector;
public Vector(long ...vector)
{
for (long value : vector)
this.vector.add(new Long(value));
}
}
when I make a new objet like Vector a = new Vector(4,7,8); it says
java.lang.NullPointerException
I've tried Arrays.asList(array); and
for (int i=0;i<vector.lenght;i++)
this.vector.add(vector[i])
and same error