Code comments in Eclipse

Source: Internet
Author: User

1. Class annotations

Window->preference->java->code Style->code Template

Alt+shift+j the default shortcut key or

First knock "/" in two * *, then ENTER

/**
* @Description Learn to use Sikuli
* @author Administrator
* @Date July 13, 2016
* @Time 9:57:02
*/

If the time is set to @Date ${date}${time}, the time effect is as follows

@Date July 13, 2016 9:58:40

2. Method notes

Shortcut keys:

First knock "/" in two * *, then ENTER

A ${tags} will show all, parameters will be displayed, and exceptions will be obtained if an exception is thrown.

Ps:

As shown, when we click on the submenu under comments, the following pattern shows the header comment of the Java file.

The following is a detailed description of each of the subkeys:

Comments-->files (Java file comment)

Comments-->types (Java class comment)

Comments-->fields (class field comment)

Comments-->constructors (constructor comment)

Comments-->methods (Java method Comment)

Comments-->overriding methods (override method Comment)

Comments-->delegate methods (Proxy method Comment)

Comments-->getters (Java getter method Comment)

Comments-->setters (Java Setters method Comment)

Description of sub-menu under code:

code-->new Java files (new Java file Code template)

Code-->method body (method body template)

Code-->constructor body (constructor template)

Code-->getter Body (field Getter method template)

Code-->setter Body (field Setter method template)

Code-->catch Block Body (Exception Catch code block template)

The purpose of the code templates is to unify the format of the various annotations and the template of the code so that we can easily generate our own custom annotations by using Eclipse after setting up code templates.



Code comments in Eclipse

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.