Related knowledge: Introduction to three simple annotations and code examples in Java
1. Function
Program elements annotated with @Deprecated are discouraged by programmers using such elements, usually because it is dangerous or there are better options. The compiler warns when using unapproved program elements or performing rewrites in unapproved code.
2. Transmission
If a class is used with the @Deprecated annotation, the IDE will give a prompt where the class is called. But will the prompt be made if the font class IDE of this class is called?
Judging from the experimental results, it will not be possible. Because the prompts will not appear like the IDE when inserting code using the editor, screenshots are used here, and interested students can do the experiment.
The above content introduces the role and transmittance of Java @Deprecated annotations. I hope you like it.