The function and transitive _java of annotations in Java @Deprecated

Source: Internet
Author: User

Related knowledge: Three simple annotations and code examples in Java

First, the role

Program elements that @Deprecated annotations do not encourage programmers to use such elements, usually because they are dangerous or have better choices. The compiler issues a warning when using an disapproved program element or executing an override in a code that is not approved.

Second, the transfer of

If a class is used with a @deprecated annotation, the IDE gives a hint where the class is invoked. But what if you invoke the word class of this class, the IDE prompts you?

It is not to be seen from the experimental results. Because the editor inserted in the code does not appear as the IDE prompts, here to use screenshots, interested students can do the experiment.

The above content introduces the Java @Deprecated Annotation's function and the transitivity, hoped everybody likes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.