intelliJ IDEA 自动优化导入包

版权声明:欢迎任何形式的转载,但请务必注明出处。 https://blog.csdn.net/shi_hong_fei_hei/article/details/86600021

Intellij IDEA使用教程相关系列 目录

步骤:Settings→Editor→General→Auto Import,如图所示

选中Optimize imports on the fly和Add unambiguous imports on the fly

勾选Optimize imports on the fly 选项,IntelliJ IDEA 将在我们书写代码的时候自动帮我们优化导入的包,比如自动去掉一些没有用到的包。 
勾选Add unambiguous imports on the fly选项,IntelliJ IDEA 将在我们书写代码的时候自动帮我们导入需要用到的包。但是对于那些同名的包,还是需要手动 Alt + Enter 进行导入的 

猜你喜欢

转载自blog.csdn.net/shi_hong_fei_hei/article/details/86600021