Reputation: 23352
In eclipse we can surround a piece of code with try/catch. I want to surround a piece of code with if statement. Is there any shortcut key. Pressing Ctrl + 1 after selecting the block of code did not give me hint to surround with If
.
Upvotes: 9
Views: 3945
Reputation: 4433
Highlight the block of code , press Alt+Shift+Z, then choose if (3).
Upvotes: 19
Reputation: 3095
In Eclipse Galileo
Surround with
option from the context menuif statement
.Upvotes: 3