while compiling java program we are getting "Recompile with -Xlint:unchecked for details". Why we are getting this error?
Probably because you're not using generics properly. Perhaps you're mixing legacy code with generic code.
Here's a quote fro the official trail on type erasure:
Note: WarningDemo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.This can happen when using an older API that operates on raw types, as shown in the following WarningDemo program:
public class WarningDemo { public static void main(String[] args) { Box<Integer> bi; bi = createBox(); } static Box createBox() { return new Box(); } }
I suggest you follow the advice, and add the -Xlint:unchecked
option when compiling. This should reveal the which parts of the code that are problematic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With