How to use Java annotation in Java Tutorial
1. General
Annotations can be defined on methods and classes. An annotation is equivalent to a class, which is equivalent to an instance of an object. Adding annotations is equivalent to adding a flag.
Common comments: @ override: indicates the method of re parent class. This can also determine whether to overwrite the parent class method. Add this statement before the method. If the prompt is wrong, you are not the method of the overwritten parent class. If the prompt is not wrong, you are the method of the overwritten parent class@ Suppresswarnings ("deprecation"): cancels the compiler's warning (for example, the method you use is outdated) @ deprecated: this statement is also on the top of the method, indicating that the method is obsolete or used on the class