idea导包

Idea拥有自动导包的功能,下面则介绍如何使用

开启
  1. Setting–>Editor–>General–>Auto Import。

idea导包

  1. 选中Optimize import one the fly(自动去掉没有用的包)和Add unambiguous imports on the fly(自动帮我们优化导入的包)。

idea导包

关闭
  1. 将Optimize import one the fly和Add unambiguous imports on the fly去除即可。

参考文档