Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/lihua5419/article/details/89554595
1, remove the reference to the current class
Shortcut: Ctrl + the Shift + O
2, refers to the entire package is removed
In the Project Explorer, right-click the package name, select Source - Organize Imports , in fact, it is Ctrl + Shift + O
3, automatically remove references when saving codes
Windows—>Preferences—>Java—>Editor—>Save Actions
选择Perform the selected action on save,勾选Organize imports