Home > Java > JavaBase > One trick to complete IDEA automatic import (import)

One trick to complete IDEA automatic import (import)

angryTom
Release: 2019-11-26 15:46:33
forward
4274 people have browsed it

One trick to complete IDEA automatic import (import)

One trick to fix IDEA automatic import

If you are using a class that has not been imported (imported), or its For static methods or static fields, IDEA will give corresponding suggestions. Just press ⌥ (option) and press Enter to accept the suggestions. (Recommended video: java video tutorial)

One trick to complete IDEA automatic import (import)

But I think This is still cumbersome and not smart enough. How to do it?

Open IDEA's preferences and find Editor | General | Auto Import. Check Add unambiguous imports on the fly and Optimize imports on the fly (for current project).

One trick to complete IDEA automatic import (import)

After clicking "OK", the import statement will be automatically imported when copying the code.

One trick to complete IDEA automatic import (import) Of course, the prerequisite is that the import statement is single and determined. If there are multiple options, IDEA will still give corresponding suggestions for you to choose manually.

Okay, you’re done! Give yourself a pat on the back.

This article comes from php Chinese website, java tutorial column, welcome to learn!

The above is the detailed content of One trick to complete IDEA automatic import (import). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template