Java generics code compiles with javac, fails with Eclipse Helios

后端 未结 8 1646
挽巷
挽巷 2020-12-16 02:53

I have the following test class that uses generics to overload a method. It works when compiled with javac and fails to compile in Eclipse Helios. My java version is 1.6.0_2

8条回答
  •  猫巷女王i
    2020-12-16 03:39

    Eclipse and javac use different compilers. Eclipse uses a third party compiler to turn your code into bytecodes for the Java VM. Javac uses the Java compiler than Sun publishes. Therefore it is possible that identical code produces slightly different results. Netbeans I believe uses Sun's compiler so check it in there as well.

提交回复
热议问题