Idea 导包自动变成星号 Idea 导包自动变成*号的问题 java.io.* Idea 自动导包变成星号
一、问题描述
1、在使用idea开发时,经常会出现导入的包自动变成 xx.*的情况,比如下面代码:
public String read(MultipartFile file) throws IOException {
StringBuffer sb = new StringBuffer();
BufferedReader buffer = new BufferedReader(new InputStreamReader(file.getInputStream() ,"UTF-8"));
String line ;
while((line = buffer.readLine()) != null) {
sb.append(line);
}
File file1 = new File("");
FileInputStream fileInputStream = new FileInputStream("");
FileOutputStream fileOutputStream = new FileOutputStream("");
return sb.toString();
}
2、查看类前面的导包部分,会自动变成: java.io.*

本文探讨了在IntelliJ IDEA开发过程中,遇到的包导入自动转为星号(*)的问题,解释了这种行为背后的原因——代码优化防止重复导入,同时提供了如何在IDEA中调整此设置的步骤。
最低0.47元/天 解锁文章
3916





