Java Basic IDEA Shortcuts

1. Introduction to IDEA software

insert image description here

2. Use frequently used shortcut keys

  • psvm generates main method
  • sout generate System.out.pringln("");
  • ctrl+shift+carriage return line feed
  • ctrl+shift+a Action panel
  • Enter, setter, select Getter and Setter in the action panel to automatically generate get, set methods
  • In the action panel, enter, constructor, and select constructor to automatically generate a constructor (select None to indicate a no-argument constructor)
  • Enter in the action panel, toString, select toString to override the toString() method

3. Common shortcut keys for code editing

insert image description here

4. Common shortcut keys for running and debugging

insert image description here

5. Other commonly used shortcut keys

insert image description here

6. Customize shortcut keys

insert image description here
There are many Actions in Editor Actions. Select the Action you need to modify the key position,
insert image description here
right-click the Action, select Add keyboard Shortcut
insert image description here
, enter the corresponding key position, and click OK to complete the setting.
insert image description here

7.Live Template

insert image description here

Customize Live Template:
insert image description here
insert image description here
insert image description here

For example, input for2 is used to output two for loops

for(int $INDEX$ = 0; $INDEX$ < $LIMIT$; $INDEX$++){
    
    `
    `for(int $INDEX$ = 0; $INDEX$ < $LIMIT$; $INDEX$++){
    
    `
        `$End$`
    `}`
`}

insert image description here

Choose when to take effect:
insert image description here

have a test:
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_42753193/article/details/124289113