Eclipse automatically generates feature settings such as author, date comment, and more

Source: Internet
Author: User

When you write Java code using Eclipse, the automatically generated comment information is generated in a pre-set format.

Modify author, date comment format: Open windows->preferences->java->code style->code Templates, click Comments in the right window, you can see a lot of options, We can edit this comment information template.

If we want to set the author information and date information at the beginning of a Java file.

Select types, click Edit, and

/**

* @author ${user}

* ${tags}

*/

Delete the ${user}, change it to the name you want to display, delete ${tags}, click Insert Variable, select Date, and the date information will be generated automatically. When you need to add a comment, click Sources->ganarate Element Comment, or use the shortcut key Alt+shift+j, Eclipse automatically adds a comment before the class.

The specification for annotations is as follows:

File Comment Tags:

/**

* <p>title: ${file_name}</p>

* <p>description: </p>

* <p>copyright:copyright (c) 2007</p>

* <p>Company:LTGames</p>

* @author LINRZ

* @date ${date}

* @version 1.0

*/

Eclipse automatically generates feature settings such as author, date comment, and more

Related Article

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.