How to add an element to an existed list?
Posted on 2006-10-20
Assumed I have an existed list, how can I add an element to it at run time? I do as follow:
List newList = new ArrayList();
List oldList = myObject.getList();
MyElement newEle = new MyElement();
for(int i=0; i<oldList.size(); i++)
I think this way seems not so elegent. Someone has any better idea?