IDEA如何自动/手动导入包

在编写代码时,IDEA可以自动导入需要的包,可以提高开发的效率。MacOS X环境下设置如下:

ItelliJ Idea->preference→Editor→General→Auto Import

选中Optimize imports on the fly和Add unambiguous imports on the fly; 点击apply 和OK键。

Optimize imports on the fly:自动去掉一些没有用到的包
Add unambiguous imports on the fly:自动帮我们优化导入的包

猜你喜欢

转载自blog.csdn.net/weixin_38070406/article/details/78804415
今日推荐