Hello Members,
The following code compiles and runs accurately, but gives the following message:
Note: List.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
import java.util.*;
public class List {
private final static int[] array = {1,2,3,4,5,6,7,8,9,10,11,12,56};
public static void main(String args [])
{
ArrayList x = new ArrayList();
for (int i: array)
x.add(i);
System.out.println(x);
}
}
How else would I instantiate the ArrayList Object?
Thank you!