The code style consists of two aspects: cleanup, code normalization. Code cleanup can be consulted:
http://www.ibm.com/developerworks/cn/opensource/os-eclipse-clean/
Code cleanup Process:
Go to Eclipse menu: Window > Preferences > Java > Code Style > Clean up, click Import above the interface, select the Eclipse installation in the popup box
Eclipse/cleanup-profile.xml under the path, click
Open, click Apply in the lower right corner to make it effective.
Code formatting process:
Go to Eclipse menu: Window > Preferences > Java > Code Style > Formatter, import eclipse/formatter-profile.xml using a method similar to the above, and
Make it effective.
Set the implementation time for code formatting, which is usually automatically formatted when saved:
Go to Eclipse menu: Window > Preferences > Java > Editor > Save Actions, tick on perform the selected actions under Save for Mat
source code, and select Format all lines, tick on organize imports, click Apply in the lower right corner to make it effective.
Add comments in Eclipse
(1) Add a comment to the method:
On the top line of the method,/**, then enter.
(2) Add comments to the file header:
Use shortcut keys to alt+shift+j. The added annotation format can be modified by opening the parameter Settings panel from the menu window->preference and selecting: Java-
Code Style, Code Templates, select Comments on the right, select the types entry, and then choose Edit on the right to enter the editing mode. Enter edit mode
Custom annotations can be customized. You can also insert some variables, such as year, date, and so on. Finally, make sure that the Code-and New Java files
There are: "${filecomment}".
If you do not find Cleanup-profile.xml and formatter-profile.xml, you can search the Internet for a bit.
A template for the company now: