ArrayList (Java SE 23 & JDK 23)
toArray(). Returns an array containing all of the elements in this list in proper sequence (from first to last element).Returns the hash code value for this list. Specified by: hashCode in interface Collection<E>.
toArray(). Returns an array containing all of the elements in this list in proper sequence (from first to last element).Returns the hash code value for this list. Specified by: hashCode in interface Collection<E>.
java.util.ArrayList<E>. Type Parameterspublic Object[] toArray(). Returns an array containing all of the elements in this list in proper sequence (from first to last element). The returned array will be "safe" in that no references to it are maintained by this list.
toArray(). Returns an array containing all of the elements in this list in proper sequence (from first to last element).Returns the hash code value for this list. Specified by: hashCode in interface Collection<E>.
Packages java.applet java.awt java.awt.color java.awt.datatransfer java.awt.dnd java.awt.event java.awt.font java.awt.geom java.awt.im java.awt.im.spi java.awt.image ...
A thread-safe variant of ArrayList in which all mutative operations (add, set, and so on) are implemented by making a fresh copy of the underlying array.The following code can be used to dump the list into a newly allocated array of String: String[] y = x.toArray(new String[0])