-1
E:\>javac Cconv.java
Note: Cconv.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Here Cconv.java is my main class. These are two errors on command screen.

gprathour
  • 13,193
  • 5
  • 56
  • 85
  • if you get an answer to your question, you should mark that correct answer by ticking on the right tick sign on left side of answer. – gprathour Apr 15 '16 at 11:12

1 Answers1

1

This is not an error, it is a warning. Try running your code, it will run normally.

Cconv.java uses unchecked or unsafe operations. 
Note: Recompile with -Xlint:unchecked for details

It is basically shown when exact type is not shown with generic classes.

For example,

ArrayList al = new ArrayList(); //It will produce above mentioned warning.

ArrayList<String> al = new ArrayList<>();   // It will not

In first statement, you are not mentioning the type for which ArrayList is being created and as it is generic so it is unsafe operation, that is what Warning is saying. If you want to avoid it you can compile with -Xlint flag.

gprathour
  • 13,193
  • 5
  • 56
  • 85
  • Note that `javac` will generate this warning only if some operation is done on the raw list such as calling `add()`. As for `-Xlint`, it allows you not to "avoid" the warning (btw don't ignore a compiler warning) but to enable all recommended warnings such as the warning for rawtypes which is the one triggered in this case. – Julien Lopez Apr 15 '16 at 12:05