I have this program in my eclipse. And if I compile it using JDK 1.5 (build path → configure build path → java compilern → JDK compliance → compiler compliance level = 1.5), I get a type erase error for method m1
I have the option to select the compiler match level as 5 in driop down (build path → configure build path → java compilern → JDK match → compiler match level = 5), I do not get this error.
I do not see any difference in the setting that I choose. But why am I getting an error? what is the difference between 1.5 and 5
import java.util.*;
class TestWrapper
{
public static void main(String[] args) {
List<Number> ls1 = new ArrayList<Number>();
List<String> ls2 = new ArrayList<String>();
m1(ls1,ls2);
}
public static void m1(List<Integer> l1,List<Integer> l2){}
public static void m1(List<Number> l1,List<String> l2) {}
Thanks everyone for the Java answers :)
source
share