"Compiler Warning" Using or Overriding the Deprecated API "

I got a compilation warning in Java:

Note: C:\Users\*****\Desktop\sudoku\GraphicallyRepresentation.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Process completed. 

What does it mean? The program works fine, but a note is what I'm worried about.

+6
source share
2 answers

This is exactly what the error says: your program uses the part of Java that is deprecated in new versions. If you recompile with -Xlint:deprecation , it will tell you which one, and you can replace it with a new API in your code.

This Oracle thread should provide you more information .

+7
source

This means that your GraphicallyRepresentation class uses another class or calls some method that is annotated as @deprecated. This may be because for him there is a new better implementation or it is no longer relevant. You should try to avoid using obsolete apis.

" Deprecated is one that programmers are not recommended to use, usually because it is dangerous or because there is a better alternative. Compilers warn when an obsolete program element is used or redefined in non-obsolete code. "

0
source

Source: https://habr.com/ru/post/925236/


All Articles