Today I was watching a video and I saw the tutor doing a correction in his code in Eclipse
without touching the mouse. Below is the code.
System.out.println(Character.toUpperCase(ch)'c');
He changed the code to :
System.out.println(Character.toUpperCase('c'));
I have always wanted to do this because it is a pain to do it using backspaces and retype the ')' at the end. Does anyone know how to do it. Thanks
Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.
Show activity on this post. Ctrl + Shift + F formats the selected line(s) or the whole source code if you haven't selected any line(s) as per the formatter specified in your Eclipse, while Ctrl + I gives proper indent to the selected line(s) or the current line if you haven't selected any line(s).
Ctrl + . on the editor will take you to the first problem (error / warning). In your case, it will highlight ch, next you press delete twice to delete ch and ). Then you press Ctrl + Shift + P to position at the right place for inserting bracket and then press ). All these will get to what you want without using mouse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With