1. Shortcut key Syso
Debug with print output, println can accept parameters of type object, can output any type
The SYSO output is a black font, which represents the debug information.
Syse, the output is a red font, which represents the wrong output information, usually writes Syse to the catch statement block
E.printstacktrace Print error stack information, can be based on this information to trace the source of the error
2. Breakpoint Debugging
Set a breakpoint, run in debug mode, then the program runs to the breakpoint at the time of the pause (suspend), the variable page can be used to see the variable assignment, the Point resume key (shortcut is F8) can continue to run,
3. Eclipse Usage Tips
Most shortcuts have cmd keys under Apple and CTRL key under Windows
Ctrl+1 Quick Fix
Like what
int a = 100L; In this case, eclipse will have a bug fix suggestion, the mouse will be moved to the error prompt location, the bug fix suggestion pops up.
Press and hold ctrl+1 will be directly pop-up suggestions, press the arrow keys to select the way to repair
If you press F2 directly, the system will directly select the first repair method to fix the error
Ctrl+d Quick Delete Line
Shift+enter, create a new line, use the scenario is, if a line of code is very long (such as a chain method call), you do not have to move the cursor to the right and then press Enter, directly press Shift+enter can immediately change to the next line.
CTRL+F11, run code quickly
ALT + Direction/direction, quickly move lines, select multiple lines, you can quickly move multiple lines
ctrl+alt+ in/direction, quick copy line
Ctrl+m, under both Apple and Windows, is the CTRL key that maximizes the view where the cursor is located
alt+/, quick code hints, used to complete the code.
Quick completion of the code, you can set preferences for more convenient to complete.
Window-->preference-->java-->editor-->content Assist-->auto Activation-->auto Activation Triggers for Java
Write all the English letters in this text box, and if you enter a letter in the code edit area, you will be prompted immediately.
ctrl+/, Quick Notes
/**
*java Doc Comment
*/
To set the style of the Java Code Editor:
Preference-->general-->appearance-->colors and Fonts-->java-->java Editor Text ...
To redefine shortcut keys:
Preference-->general-->keys can see all of the shortcut keys defined in eclipse
You can also select the specified shortcut key to redefine it
Java Development debugging tips and how to use the Eclipse shortcut keys