Is there any difference in between these three, assuming a
has type ArrayList<T>
? (Aside from the fact that the compiler complains about unchecked operations in #3.)
1.
ArrayList<T> a1 = new ArrayList<T> (a);
2.
ArrayList<T> a2 = new ArrayList<T> ();
a2.addAll (a);
3.
ArrayList<T> a3 = (ArrayList<T>) (a.clone());