Ctrl + Shift + O – 管理import语句并移除未使用的语句。
保存文件的时候自动格式化源代码并自动管理import语句, 到 Window -> Preferences -> Java -> Editor -> Save Actions并启用 Perform the selected actions on save,选中 Format source code和 organize imports。
转载于:https://my.oschina.net/nianer/blog/180317