Idea中设置自动导入或删除包
第一步:
在File->Settings中打开设置(或Alt+Ctrl+S)
第二步:
进入Editor->General->Auto Import选项页,勾选Addunambiguous imports on the fly和Optimize import on yhe fly (for current project),然后OK
此时就可以实现自动导包和删除了。
注释:
Add unambiguous imports on the fly 动态添加明确的导入
Optimize imports on the fly 即时优化导入