Hi ,
Can any body throw some light on why I am getting error at line 1 and compile warning on line 2 in the following code
import java.util.* ;
class A {
public static void main(
String[] args) {
List<?> myList = new ArrayList();
method1(myList);
myList.add(new Integer(10)); // Line 1 //COMPILER ERROR .
method2(myList); // Line 2 // COMPILER WARNING
}
static void method1(List x){
}
static void method2(List x){
x.add(new Integer(20));
}
[ October 09, 2007: Message edited by: Akhil Maharaj ]