Posted on 2006-07-17 17:07
肖鹏 阅读(259)
评论(0) 编辑 收藏
1.
vectorObj.trimToSize(); //(optional) insure you won't have empty elements
ArrayObj[] objs = new ArrayObj[vectorObj.size()];
vectorObj.toArray(objs);
return objs.
2.
Object[] tempObjectArray = vectorObj.toArray();
ArrayObj[] objs = new ArrayObj[ tempObjectArray.size() ];
System.arraycopy (tempObjectArray, 0, objs, 0, objs.size() );
return objs;