First, the Code shortcut keys
1. Create an independent workspace
File->swicth->other-> Choosing a space to establish a location facilitates the orderly management of the project
2. Display Line numbersWindows->preferences->editor->text Editor->show Line Nuber
3. Code hintsManual tip: alt+/Auto tip: windows->preferences->java->editor->content Assist->auto activation triggers for Java Modify into Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz._
4. Quick Notes
Line Comment: ctrl+/block Comment: ctrl+shift+/remove ctrl+shift+\ mouse Comment: shift+ left button
5. Quickly switch the edit window
Ctrl+m Quick Window Zoom CTRL+F6 Quick switch Different classes ctrl+w close windows
6. Quick Change CaseCtrl+shift+x lowercase quick Convert to uppercase Ctrl+shift+y uppercase quick change to lowercase
7. Quickly delete line codes
Ctrl+dQuick cut Code alt+↑ or alt+↓ quick copy shift +alt +↑ or shift+alt+↓
8. Quick Write code block try and catch
Shift+alt+z
9. Quick Guide Package
Ctrl+shift+o
10. Add Javadoc comments quickly
Ctrl+shift+j
11. Quick return to last edit pointCtrl+q
second, the code beautification
1. Formatting codeSource->format shortcut key ctrl+shift+f can also be customized with Format style
2. Sorting method names Source->sort members method names are sorted alphabetically
3. Quick removal of excess import package
Source->organize Imports
4. Change Replace all method names or variable names
1.ctrl+f 2. Using rename
5. Code Refactoring
Refactor->extract method extracts the code into methods Refactor->extract local Variable to extract the parameters into local variables refactor->extract Inter Face directly abstracts out the interface
Refactor->extractor Constant extracting a static field
Refactor->introduce Parameter the Rerurn return value into a parameter is passed in by the outside
Refactor->change method Signature Modify the methods name, parameters, etc. refactor->pull up properties, methods, etc. move (parent class moved to subclass) Refactor->pu Sh down property, method, etc. move (parent class moved to child Class)
6. Read the Code
shift to quickly view code definitionsCTRL quick access Code Ctrl+o lists the code outline (two times you can display a member of the parent Class) Ctrl+t View the tree of class inheritance Ctrl+shift+t Quick Locate class (quickly find the location of a class) Ctrl+shift+p fast Quick position Brackets Ctrl+j Forward Incremental Lookup ctrl+shift+j Reverse incremental lookup ctrl+i jump to a row quickly
7. Debugging Code
Conditional breakpoint: (right-click) Breakpoint Properties->hit count (number of breakpoints) (right-click)Breakpoint Properties->conditional (similar to i==0 Boolean values)Exception Breakpoint: j! is an exception breakpoint option
8. Set Chinese UTF-8 (solve garbled problem)The default workspace encoding method, General--workspace--text file encoding modify the project code, right-click on the project--properties--resource--text file encoding modify the way files are encoded, and modify the engineering code basically consistent, right-click on the file--properties modify the default encoding of a class of files such as. jar,general--content Types, select the file type you want to modify, the default Encoding below
9. Import files If the normal method is not available, you can try to use the file system
Eclipse Usage Tips