IntelliJ IDEA可以自动优化导入包,但是有多个同名的类位于不同的包时,需要手动使用Alt + Enter进行导入。
坐标: File --> Settings --> Editor --> General --> AutoImport -->
把 Add unambiguous imports on the fiy 和 Optimize imports on the fly (for current project) 两个都打上√ --> Apply --> OK

本文介绍如何在IntelliJ IDEA中优化自动导入包的设置,解决多个同名类位于不同包时的手动导入问题。通过调整设置,可以实现更智能的包导入,提高开发效率。
坐标: File --> Settings --> Editor --> General --> AutoImport -->
把 Add unambiguous imports on the fiy 和 Optimize imports on the fly (for current project) 两个都打上√ --> Apply --> OK

495
3561
6048
1479

被折叠的 条评论
为什么被折叠?