arraylist - Java lists strange size malfunction -
this question has answer here:
- initial size arraylist 11 answers
i initialize list, this:
public list<edge> edges = new arraylist<edge>(8);
after that, size, following code gives zero.
system.out.println("size: " + edges.size());
there isn't value change or method call beetwen 2 lines. can causes this?
the parameter constructor capacity.
the capacity number of elements underlying array can hold before needs resizing.
Comments
Post a Comment