Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse keyboard shortcut for passing a parameter to a method

Tags:

java

eclipse

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

like image 930
yovan786 Avatar asked Feb 24 '14 17:02

yovan786


People also ask

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

What does Ctrl Shift F do in Eclipse?

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).


1 Answers

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.

like image 148
Hrishikesh Kumar Avatar answered Sep 23 '22 19:09

Hrishikesh Kumar