IntelliJ Organize Imports

后端 未结 14 1043
孤街浪徒
孤街浪徒 2020-12-02 04:48

Does IntelliJ have an Organize Imports feature similar to that in Eclipse? What I have is a Java file with multiple classes missing their imports. Example:

p         


        
14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 05:18

    If you are missing just one import (the class name has red underline), click and hover the mouse over it, and a blue suggested import statement will appear. If you hit, Alt + Enter at this point, the import will be included in the file and the red underline should disappear.

提交回复
热议问题