Question: what is toarray method in java?
Answer: The toArray() method is used to get an array which contains all the elements in ArrayList object in proper sequence (from first to last element). Package: java.util.