Answers for "ArrayList.toArray(T[])"

0

ArrayList Object

import java.util.ArrayList;
import java.util.List;
public class ArrayListObjectToArrayMethodExample
{
   public static void main(String[] args)
   {
      List<Integer> al = new ArrayList<Integer>();
      al.add(12);
      al.add(14);
      al.add(16);
      al.add(18);
      al.add(20);
      Object[] obj = al.toArray();
      for(Object num : obj)
      {
         System.out.print(num + " ");
      }
   }
}
Posted by: Guest on January-01-1970

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language