Any reason to clean up unused imports in Java, other than reducing clutter?

后端 未结 11 1356
生来不讨喜
生来不讨喜 2020-11-28 06:34

Is there any good reason to avoid unused import statements in Java? As I understand it, they are there for the compiler, so lots of unused imports won\'t have any impacts o

11条回答
  •  星月不相逢
    2020-11-28 07:27

    There is no any performance impact, though for readability you can make it clean. Removing unused imports is quite simple in both Eclipse and IntelliJ IDEA.

    Eclipse

    Windows / Linux -   Ctrl+Shift+O

    Mac -                       Cmd+Shift+O

    IntelliJ IDEA or Android Studio

    Windows / Linux -   Ctrl+Alt+O

    Mac -                       Cmd+Alt+O

提交回复
热议问题