You typically debug code by testing many lines one at a time while debugging. You must, therefore, comment code when debugging.
It would be good if we were aware of this life-saving shortcut for commenting on a block of code
if you love Netbeans editor. Using [ctrl]+[shift]+ , we can easily comment part of the code in Netbeans. You have to select a block of code before applying this shortcut. It would comment out your code. The best part of this shortcut is a toggle.
This means if you want to uncomment the code block then you would have to reselect the entire commented code and reapply [ctrl]+[shift]+.
NetBeans Shortcut List 2021
To delete current line | [ctrl] + [e] or [shift] + [delete] |
To delete next word after the cursor | [ctrl] + [delete] |
It would copy the line and move up | [ctrl] + [shift] + [up] |
It would copy the line and move down | [ctrl] + [shift] + [down] |
Without Copying it would move line up | [alt] + [shift] + [up] |
Without Copying it would move line down | [alt] + [shift] + [down] |
Go to line | [ctrl] + [g] |
Format a line of code | [alt] + [shift] + [f] OR [ctrl] + [shift] + [f] |
To switch among open files | [ctrl]+[tab] |
Find next in code | [f3] |