Short cut keywords to write java code in IntelliJ IDEA tool

Category : Java | Sub Category : Interview Questions | By Prasad Bonam Last updated: 2023-07-09 01:28:05 Viewed : 332


Short cut keywords to write java code in IntelliJ IDEA tool


IntelliJ IDEA is a powerful Java IDE that provides several shortcuts and code templates to help you write code more efficiently. Here are some commonly used shortcuts and keywords in IntelliJ IDEA:

  1. psvm: Shortcut to generate the main method.

  2. sout: Shortcut to generate a System.out.println() statement.

  3. Ctrl + Space: Automatic code completion. It suggests possible code completions based on the context.

  4. Ctrl + Shift + Enter: Automatically completes a statement. It adds missing semicolons, parentheses, or braces and positions the cursor correctly.

  5. Ctrl + Alt + L: Reformat code. It automatically reformats your code according to the coding style settings.

  6. Ctrl + D: Duplicates the current line or selection.

  7. Ctrl + /: Comments/uncomments the selected lines of code.

  8. Ctrl + Alt + T: Surrounds the selected code with a code construct (if statement, try-catch, etc.).
  9. Ctrl + Shift + Space: Smart code completion. It suggests the most relevant code completions based on the variable types and expected expressions.
  10. Ctrl + E: Switches between open tabs in the editor.
  11. Ctrl + Shift + F: Searches for a specific text or code within the project.
  12. Ctrl + Shift + F7: Highlights all occurrences of the selected variable or code in the current file.
  13. Alt + Enter: Shows the context menu with quick-fix options for code issues.
  14. Ctrl + N: Opens the "Go to Class" dialog to quickly navigate to a specific class.
  15. Ctrl + Shift + N: Opens the "Go to File" dialog to quickly navigate to a specific file.

These are just a few examples of the many shortcuts and features available in IntelliJ IDEA. You can explore the IDEs documentation or check out the Keymap settings to customize shortcuts based on your preferences.

Search
Related Articles

Leave a Comment: