instructions

IDEA has a universal shortcut key (Alt Enter), which is very powerful. The same shortcut key can prompt you to do different operations according to different contexts. Many people may not know these functions, but also handle them manually when dealing with codes.

Alt Enter can do a lot of things for you, but I’ve come up with about 17 things:

  • Converting lambda expressions
  • Equals the flip
  • Automatic guide package
  • Exception handling
  • SimpleDateFormat is converted to ThreadLocal encapsulated SimpleDateFormat
  • Annotation mobile
  • Easy JSON string handling
  • Convert to efficient binary
  • The if… Else becomes simple ternary operation and some simplified operations
  • Introducing local variables
  • Implementing an interface
  • Implementing abstract classes
  • Fix method return value, add input parameter, decrease input parameter, method generation, etc
  • String related operations
  • , + < and so on
  • Java access modifier change operations
  • Automatically generate property actions

In order to give you a more intuitive view of the effect, I recorded a GIF demo.

Converting lambda expressions

Equals the flip

Automatic guide package

Exception handling

SimpleDateFormat is converted to ThreadLocal encapsulated SimpleDateFormat

Annotation mobile

Easy JSON string handling

Convert to efficient binary

The if… Else becomes simple ternary operation and some simplified operations

Introducing local variables

Implementing an interface

Implementing abstract classes

Fix method return value, add input parameter, decrease input parameter, method generation, etc

String related operations

, + < and so on

Java access modifier change operations

Automatically generate property actions

conclusion

Conclusion: Alt Enter is awesome, try pressing it when you don’t know what to do, it may surprise you!!


If you feel that you have gained something after reading it, please click “like”, “follow” and add the official account “Ingenuity Zero” to check out more wonderful history!!