ArrayList list = new ArrayList(); list.add(1); list.add(\"Java\"); list.add(3.14); System.out.println(list.toString());
If you want to do it the dirty way, try this.
@SuppressWarnings("unchecked") public ArrayList convert(ArrayList a) { return (ArrayList) a; }
Advantage: here you save time by not iterating over all objects.
Disadvantage: may produce a hole in your foot.