方法一 快捷键 CTRL + ALT + O 方法二 【自动方法】设置自动清除 settings -> editing -> general -> auto import -> java项中勾选optimize imports on the fly