Convert an ArrayList to an object array

后端 未结 6 1112
情深已故
情深已故 2020-12-13 09:20

Is there a command in java for conversion of an ArrayList into a object array. I know how to do this copying each object from the arrayList into the object array, but I was

6条回答
  •  隐瞒了意图╮
    2020-12-13 09:43

    Yes. ArrayList has a toArray() method.

    http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html

提交回复
热议问题