Use and instance of annotations in Java (i)

Source: Internet
Author: User

Http://www.cnblogs.com/pepcod/archive/2013/02/16/2913474.html

Annotations are currently very popular, and many mainstream frameworks support annotations, and when you write your own code, you try to use annotations as much as possible, but the code is more concise.

The syntax of annotations is simple, except for the use of the @ symbol, which is basically consistent with the Java intrinsic syntax. There are three standard annotations built into the Java SE5:

@Override that indicates that the current method definition overrides a method in the superclass.

@Deprecated, the element compiler that uses annotations for it will issue a warning because the annotation @deprecated is deprecated code, which is not approved for use.

@SuppressWarnings, turn off improper compiler warning messages.

How much of the above three annotations we are going to have when writing code. Java also provides 4 of annotations, specifically responsible for the creation of new annotations.

How does the annotations in Java work?

Http://www.importnew.com/10294.html

Java Annotations (usage and testing of custom method annotations)

http://blog.csdn.net/tanxiang21/article/details/8914322

Use and instance of annotations in Java (i)

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.