The 10 positions of IntelliJ idea’s intelligent completion are awesome.

Time:2019-10-21

More than a year ago, the stack manager just succeeded in the transformation of idea from eclipse. Many times in front of him were failures and tears. Later, I wrote this article in the wechat public account “Java technology stack”: IntelliJ idea’s very 6 10 postures! , exclaim at the power of idea intelligent prompt, and also show respect for idea.

As for intelligent tips, this time I will share another article about auto completion.

First, let’s take a look at the figure below. Enter a… After the effective position in the method. At the end, all the available auto completion keywords will be listed, which is what we are going to share today.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

Here are a few of their usage. In fact, it’s very simple. Like the last time, I also recorded a moving picture this time. It’s more intuitive and awesome.

1. Fast printout

In addition to the quick generation at the beginning of Sout, it can also be generated later.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

2. Define local variables quickly

In string or number… Enter. VaR, enter, and idea will automatically infer and quickly define a local variable, but it is of final type.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

3. Quickly define member variables

Enter. Field after the value to quickly define a member variable. If the current method is static, the generated variable is also static.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

4. Quick format string

Enter. Format after the string, enter, and idea will automatically generate a string. Format… Statement, awesome!

The 10 positions of IntelliJ idea's intelligent completion are awesome.

5. Quick judgment (not) empty

if (xx != null)
if (xx == null)

There are many cases of judging null / non null like the above. In fact, if statement blocks can be generated quickly, non null:. Notnull or. NN, null:. Null.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

6. Quick reverse judgment

Enter. Not to quickly negate the Boolean value, and then enter. If to quickly generate if judgment statement block.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

7. Fast traversal set

The following is a quick generation demonstration of several for loop statements. For,. Fori,. Forr can meet your requirements.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

8. Quick return value

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

The 10 positions of IntelliJ idea's intelligent completion are awesome.

9. Fast generation of synchronization lock

Enter. Synchronized after the object to quickly generate the synchronized lock statement block of the object.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

10. Quickly generate jdk8 statements

The following is a quick generation of lambda and optional statements.

The 10 positions of IntelliJ idea's intelligent completion are awesome.

Well, today, the stack master introduced how IntelliJ idea can use the quick completion function and rising posture.

Pay attention to the wechat public account of Java technology stack, and the stack leader will continue to share the practical course of IntelliJ idea. The public account will be pushed as soon as possible, with continuous attention. Reply in the background of the public account: idea, get more IntelliJ idea tutorials organized by the stack leader. They are all practical goods. The following is only a partial preview.

  • Detailed illustration of the most commonly used configuration of IntelliJ idea
  • IntelliJ idea’s very 6 10 postures
  • IntelliJ idea all garbled solutions
  • Four unique skills of IntelliJ idea reading source code
  • IntelliJ idea debug debugging skills
  • ……

If you like idea, you can join our knowledge planet Java technology stack. I will often share the tips of using idea on it. If you don’t know anything about idea, you can ask me and you.

This article originated from the wechat public account: Java technology stack (ID: javastack). You can get more tutorials by following the reply of the public account to “idea” in the background. Please keep this information as it is.