Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the methods of intelligent completion of Intellij IDEA

Shulou Source: shulou.com Published: 2022-06-01 23:15:09 10月26日 Update

This article introduces the relevant knowledge of "what are the methods of Intellij IDEA intelligence completion". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, take a look at the following picture, enter a. After the valid position in the method, and finally list all available auto-completion keywords, which is what you want to share today.

Here are a few more of their uses, which are actually very simple, just like last time, I also recorded a motion picture this time, which makes it more intuitive and looks more powerful.

1. Fast printout

In addition to fast generation at the beginning of sout, it can also be generated quickly later.

2. Quickly define local variables

In strings or numbers... Enter .var, enter, and IDEA will automatically infer and quickly define a local variable, but it is of type final.

3. Quickly define member variables

By typing .field after the value, you can quickly define a member variable, and if the current method is static, the resulting variable is also static.

4. Quickly format strings

Enter .format after the string, enter, and IDEA will automatically generate String.format.... Sentence, awesome!

5. Quickly determine (non) empty if (xx! = null) if (xx = = null)

There are a lot of cases of judging null / non-empty like the one above. In fact, you can quickly generate if judgment blocks, non-empty: .notnull or .nn, null: .null.

6. Quick reverse judgment

Enter .not to make Boolean values quickly inverted, and then enter .if to quickly generate if judgment statements.

7. Traverse the collection quickly

The following is a demonstration of the rapid generation of several for loop statements, .for, .fori, .forr can meet your requirements.

8. Quick return value

Enter .return after the value to make the current value return quickly.

9. Quickly generate synchronization locks

Enter .synchronized after the object to quickly generate a block of synchronization lock statements for that object.

10. Quickly generate JDK8 statements

The following demonstrates the rapid generation of Lambda and Optional statements.

This is the end of the content of "what are the methods of Intellij IDEA Intelligence completion". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Generate input statement variable method content character string intelligence object local situation member more knowledge static synchronization presentation output practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Microsoft Docker Shulou Information